Merge "Use assert(Not)In/Greater(Equal)/LessEqual/IsNotNone"

This commit is contained in:
Jenkins 2016-10-13 10:33:53 +00:00 committed by Gerrit Code Review
commit 44c186bc70
13 changed files with 63 additions and 63 deletions

View File

@ -800,7 +800,7 @@ class ResponseObjectTest(test.TestCase):
robj = wsgi.ResponseObject({}) robj = wsgi.ResponseObject({})
robj['Header'] = 'foo' robj['Header'] = 'foo'
del robj['hEADER'] del robj['hEADER']
self.assertFalse('header' in robj.headers) self.assertNotIn('header', robj.headers)
def test_header_isolation(self): def test_header_isolation(self):
robj = wsgi.ResponseObject({}) robj = wsgi.ResponseObject({})

View File

@ -185,7 +185,7 @@ class ExperimentalAPITestCase(test.TestCase):
self.assertEqual(experimental, self.assertEqual(experimental,
response.headers.get(experimental_header_name)) response.headers.get(experimental_header_name))
else: else:
self.assertFalse(experimental_header_name in response.headers) self.assertNotIn(experimental_header_name, response.headers)
def test_experimental_api_called_when_requested(self): def test_experimental_api_called_when_requested(self):
@ -205,7 +205,7 @@ class ExperimentalAPITestCase(test.TestCase):
response = self.req.get_response(self.app) response = self.req.get_response(self.app)
self.assertEqual(404, response.status_int) self.assertEqual(404, response.status_int)
self.assertFalse(experimental_header_name in response.headers) self.assertNotIn(experimental_header_name, response.headers)
def test_experimental_header_returned_in_exception(self): def test_experimental_header_returned_in_exception(self):

View File

@ -108,9 +108,9 @@ class ShareNetworkAPITest(test.TestCase):
self.assertEqual(share_nw['created_at'], view['created_at']) self.assertEqual(share_nw['created_at'], view['created_at'])
self.assertEqual(share_nw['updated_at'], view['updated_at']) self.assertEqual(share_nw['updated_at'], view['updated_at'])
self.assertFalse('shares' in view) self.assertNotIn('shares', view)
self.assertFalse('network_allocations' in view) self.assertNotIn('network_allocations', view)
self.assertFalse('security_services' in view) self.assertNotIn('security_services', view)
@ddt.data( @ddt.data(
{'nova_net_id': 'fake_nova_net_id'}, {'nova_net_id': 'fake_nova_net_id'},

View File

@ -186,7 +186,7 @@ class TestManilaMigrationsMySQL(ManilaMigrationsCheckers,
text(sanity_check), text(sanity_check),
database=self.engine.url.database) database=self.engine.url.database)
self.assertTrue(total.scalar() > 0, "No tables found. Wrong schema?") self.assertGreater(total.scalar(), 0, "No tables found. Wrong schema?")
noninnodb_query = """ noninnodb_query = """
SELECT count(*) SELECT count(*)

View File

@ -309,7 +309,7 @@ class ShareDatabaseAPITestCase(test.TestCase):
self.assertTrue(expected_ss_keys.issubset( self.assertTrue(expected_ss_keys.issubset(
replica['share_server'].keys())) replica['share_server'].keys()))
else: else:
self.assertFalse('share_server' in replica.keys()) self.assertNotIn('share_server', replica.keys())
self.assertEqual( self.assertEqual(
with_share_data, with_share_data,
expected_share_keys.issubset(replica.keys())) expected_share_keys.issubset(replica.keys()))
@ -358,7 +358,7 @@ class ShareDatabaseAPITestCase(test.TestCase):
self.assertTrue(expected_ss_keys.issubset( self.assertTrue(expected_ss_keys.issubset(
replica['share_server'].keys())) replica['share_server'].keys()))
else: else:
self.assertFalse('share_server' in replica.keys()) self.assertNotIn('share_server', replica.keys())
self.assertEqual(with_share_data, self.assertEqual(with_share_data,
expected_share_keys.issubset(replica.keys())) expected_share_keys.issubset(replica.keys()))
@ -1125,7 +1125,7 @@ class ShareInstanceExportLocationsMetadataDatabaseAPITestCase(test.TestCase):
for el in els: for el in els:
if el.path == path: if el.path == path:
export_location_uuid = el.uuid export_location_uuid = el.uuid
self.assertFalse(export_location_uuid is None) self.assertIsNotNone(export_location_uuid)
return export_location_uuid return export_location_uuid
def test_get_export_locations_by_share_id(self): def test_get_export_locations_by_share_id(self):
@ -1529,7 +1529,7 @@ class ShareNetworkDatabaseAPITestCase(BaseDatabaseAPITestCase):
filter_by(security_service_id=security_dict1['id']).\ filter_by(security_service_id=security_dict1['id']).\
filter_by(share_network_id=self.share_nw_dict['id']).first() filter_by(share_network_id=self.share_nw_dict['id']).first()
self.assertTrue(result is not None) self.assertIsNotNone(result)
def test_add_security_service_not_found_01(self): def test_add_security_service_not_found_01(self):
security_service_id = 'unknown security service' security_service_id = 'unknown security service'
@ -1593,7 +1593,7 @@ class ShareNetworkDatabaseAPITestCase(BaseDatabaseAPITestCase):
filter_by(security_service_id=security_dict1['id']).\ filter_by(security_service_id=security_dict1['id']).\
filter_by(share_network_id=self.share_nw_dict['id']).first() filter_by(share_network_id=self.share_nw_dict['id']).first()
self.assertTrue(result is None) self.assertIsNone(result)
share_nw_ref = db_api.share_network_get(self.fake_context, share_nw_ref = db_api.share_network_get(self.fake_context,
self.share_nw_dict['id']) self.share_nw_dict['id'])

View File

@ -531,7 +531,7 @@ class ShareManagerTestCase(test.TestCase):
shr = db.share_get(self.context, share_id) shr = db.share_get(self.context, share_id)
self.assertEqual(constants.STATUS_AVAILABLE, shr['status']) self.assertEqual(constants.STATUS_AVAILABLE, shr['status'])
self.assertTrue(len(shr['export_location']) > 0) self.assertGreater(len(shr['export_location']), 0)
self.assertEqual(2, len(shr['export_locations'])) self.assertEqual(2, len(shr['export_locations']))
def test_create_share_instance_for_share_with_replication_support(self): def test_create_share_instance_for_share_with_replication_support(self):
@ -1174,8 +1174,8 @@ class ShareManagerTestCase(test.TestCase):
self.assertEqual(2, mock_export_locs_update.call_count) self.assertEqual(2, mock_export_locs_update.call_count)
self.assertEqual(2, mock_replica_update.call_count) self.assertEqual(2, mock_replica_update.call_count)
self.assertTrue( self.assertIn(
reset_replication_change_call in mock_replica_update.mock_calls) reset_replication_change_call, mock_replica_update.mock_calls)
self.assertTrue(mock_info_log.called) self.assertTrue(mock_info_log.called)
self.assertFalse(mock_snap_instance_update.called) self.assertFalse(mock_snap_instance_update.called)
@ -1739,7 +1739,7 @@ class ShareManagerTestCase(test.TestCase):
shr = db.share_get(self.context, share_id) shr = db.share_get(self.context, share_id)
self.assertEqual(shr['status'], constants.STATUS_AVAILABLE) self.assertEqual(shr['status'], constants.STATUS_AVAILABLE)
self.assertEqual(shr['share_server_id'], share_srv['id']) self.assertEqual(shr['share_server_id'], share_srv['id'])
self.assertTrue(len(shr['export_location']) > 0) self.assertGreater(len(shr['export_location']), 0)
self.assertEqual(1, len(shr['export_locations'])) self.assertEqual(1, len(shr['export_locations']))
manager.LOG.info.assert_called_with(mock.ANY, share.instance['id']) manager.LOG.info.assert_called_with(mock.ANY, share.instance['id'])

View File

@ -399,20 +399,20 @@ class MonkeyPatchTestCase(test.TestCase):
self.assertEqual(8, ret_b) self.assertEqual(8, ret_b)
package_a = self.example_package + 'example_a.' package_a = self.example_package + 'example_a.'
self.assertTrue(package_a + 'example_function_a' self.assertIn(package_a + 'example_function_a',
in manila.tests.monkey_patch_example.CALLED_FUNCTION) manila.tests.monkey_patch_example.CALLED_FUNCTION)
self.assertTrue(package_a + 'ExampleClassA.example_method' self.assertIn(package_a + 'ExampleClassA.example_method',
in manila.tests.monkey_patch_example.CALLED_FUNCTION) manila.tests.monkey_patch_example.CALLED_FUNCTION)
self.assertTrue(package_a + 'ExampleClassA.example_method_add' self.assertIn(package_a + 'ExampleClassA.example_method_add',
in manila.tests.monkey_patch_example.CALLED_FUNCTION) manila.tests.monkey_patch_example.CALLED_FUNCTION)
package_b = self.example_package + 'example_b.' package_b = self.example_package + 'example_b.'
self.assertFalse(package_b + 'example_function_b' self.assertNotIn(package_b + 'example_function_b',
in manila.tests.monkey_patch_example.CALLED_FUNCTION) manila.tests.monkey_patch_example.CALLED_FUNCTION)
self.assertFalse(package_b + 'ExampleClassB.example_method' self.assertNotIn(package_b + 'ExampleClassB.example_method',
in manila.tests.monkey_patch_example.CALLED_FUNCTION) manila.tests.monkey_patch_example.CALLED_FUNCTION)
self.assertFalse(package_b + 'ExampleClassB.example_method_add' self.assertNotIn(package_b + 'ExampleClassB.example_method_add',
in manila.tests.monkey_patch_example.CALLED_FUNCTION) manila.tests.monkey_patch_example.CALLED_FUNCTION)
class FakeSSHClient(object): class FakeSSHClient(object):

View File

@ -53,7 +53,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND) @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
def test_list_share_servers_without_filters(self): def test_list_share_servers_without_filters(self):
servers = self.shares_client.list_share_servers() servers = self.shares_client.list_share_servers()
self.assertTrue(len(servers) > 0) self.assertGreater(len(servers), 0)
keys = [ keys = [
"id", "id",
"host", "host",
@ -70,11 +70,11 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
if server["updated_at"]: if server["updated_at"]:
self.assertTrue(self.date_re.match(server["updated_at"])) self.assertTrue(self.date_re.match(server["updated_at"]))
# Host is not empty # Host is not empty
self.assertTrue(len(server["host"]) > 0) self.assertGreater(len(server["host"]), 0)
# Id is not empty # Id is not empty
self.assertTrue(len(server["id"]) > 0) self.assertGreater(len(server["id"]), 0)
# Project id is not empty # Project id is not empty
self.assertTrue(len(server["project_id"]) > 0) self.assertGreater(len(server["project_id"]), 0)
# Do not verify statuses because we get all share servers from whole # Do not verify statuses because we get all share servers from whole
# cluster and here can be servers with any state. # cluster and here can be servers with any state.
@ -103,7 +103,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
raise lib_exc.NotFound(message=msg) raise lib_exc.NotFound(message=msg)
search_opts = {"host": host} search_opts = {"host": host}
servers = self.shares_client.list_share_servers(search_opts) servers = self.shares_client.list_share_servers(search_opts)
self.assertTrue(len(servers) > 0) self.assertGreater(len(servers), 0)
for server in servers: for server in servers:
self.assertEqual(server["host"], host) self.assertEqual(server["host"], host)
@ -129,7 +129,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
raise lib_exc.NotFound(message=msg) raise lib_exc.NotFound(message=msg)
search_opts = {"status": status} search_opts = {"status": status}
servers = self.shares_client.list_share_servers(search_opts) servers = self.shares_client.list_share_servers(search_opts)
self.assertTrue(len(servers) > 0) self.assertGreater(len(servers), 0)
for server in servers: for server in servers:
self.assertEqual(server["status"], status) self.assertEqual(server["status"], status)
@ -138,7 +138,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
search_opts = {"project_id": self.share_network["project_id"]} search_opts = {"project_id": self.share_network["project_id"]}
servers = self.shares_client.list_share_servers(search_opts) servers = self.shares_client.list_share_servers(search_opts)
# Should exist, at least, one share server, used by this test suite. # Should exist, at least, one share server, used by this test suite.
self.assertTrue(len(servers) > 0) self.assertGreater(len(servers), 0)
for server in servers: for server in servers:
self.assertEqual(server["project_id"], self.assertEqual(server["project_id"],
self.share_network["project_id"]) self.share_network["project_id"])
@ -148,7 +148,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
search_opts = {"share_network": self.share_network["name"]} search_opts = {"share_network": self.share_network["name"]}
servers = self.shares_client.list_share_servers(search_opts) servers = self.shares_client.list_share_servers(search_opts)
# Should exist, at least, one share server, used by this test suite. # Should exist, at least, one share server, used by this test suite.
self.assertTrue(len(servers) > 0) self.assertGreater(len(servers), 0)
for server in servers: for server in servers:
self.assertEqual(server["share_network_name"], self.assertEqual(server["share_network_name"],
self.share_network["name"]) self.share_network["name"])
@ -158,7 +158,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
search_opts = {"share_network": self.share_network["id"]} search_opts = {"share_network": self.share_network["id"]}
servers = self.shares_client.list_share_servers(search_opts) servers = self.shares_client.list_share_servers(search_opts)
# Should exist, at least, one share server, used by this test suite. # Should exist, at least, one share server, used by this test suite.
self.assertTrue(len(servers) > 0) self.assertGreater(len(servers), 0)
for server in servers: for server in servers:
self.assertIn(server["share_network_name"], self.assertIn(server["share_network_name"],
self.sn_name_and_id) self.sn_name_and_id)
@ -186,15 +186,15 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
if server["updated_at"]: if server["updated_at"]:
self.assertTrue(self.date_re.match(server["updated_at"])) self.assertTrue(self.date_re.match(server["updated_at"]))
# Host is not empty # Host is not empty
self.assertTrue(len(server["host"]) > 0) self.assertGreater(len(server["host"]), 0)
# Id is not empty # Id is not empty
self.assertTrue(len(server["id"]) > 0) self.assertGreater(len(server["id"]), 0)
# Project id is not empty # Project id is not empty
self.assertTrue(len(server["project_id"]) > 0) self.assertGreater(len(server["project_id"]), 0)
# Status is not empty # Status is not empty
self.assertTrue(len(server["status"]) > 0) self.assertGreater(len(server["status"]), 0)
# share_network_name is not empty # share_network_name is not empty
self.assertTrue(len(server["share_network_name"]) > 0) self.assertGreater(len(server["share_network_name"]), 0)
# backend_details should be a dict # backend_details should be a dict
self.assertIsInstance(server["backend_details"], dict) self.assertIsInstance(server["backend_details"], dict)

View File

@ -100,7 +100,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
# list share types # list share types
st_list = self.shares_v2_client.list_share_types(version=version) st_list = self.shares_v2_client.list_share_types(version=version)
sts = st_list["share_types"] sts = st_list["share_types"]
self.assertTrue(len(sts) >= 1) self.assertGreaterEqual(len(sts), 1)
self.assertTrue(any(st_id in st["id"] for st in sts)) self.assertTrue(any(st_id in st["id"] for st in sts))
for st in sts: for st in sts:
self._verify_is_public_key_name(st, version) self._verify_is_public_key_name(st, version)

View File

@ -150,7 +150,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertDictContainsSubset( self.assertDictContainsSubset(
filters['metadata'], share['metadata']) filters['metadata'], share['metadata'])
@ -170,7 +170,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
shares_ids = [s["id"] for s in shares] shares_ids = [s["id"] for s in shares]
for share in self.shares: for share in self.shares:
self.assertIn(share["id"], shares_ids) self.assertIn(share["id"], shares_ids)
@ -198,7 +198,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
st_list = self.shares_client.list_share_types() st_list = self.shares_client.list_share_types()
# find its name or id, get id # find its name or id, get id
@ -229,7 +229,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertEqual(filters['host'], share['host']) self.assertEqual(filters['host'], share['host'])
@ -244,7 +244,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertEqual( self.assertEqual(
filters['share_network_id'], share['share_network_id']) filters['share_network_id'], share['share_network_id'])
@ -259,7 +259,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertEqual(filters['snapshot_id'], share['snapshot_id']) self.assertEqual(filters['snapshot_id'], share['snapshot_id'])
self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares]) self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares])
@ -272,7 +272,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
sorted_list = [share['created_at'] for share in shares] sorted_list = [share['created_at'] for share in shares]
self.assertEqual(sorted(sorted_list), sorted_list) self.assertEqual(sorted(sorted_list), sorted_list)
@ -295,7 +295,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
# list shares by active status, at least one share is expected # list shares by active status, at least one share is expected
params = {"status": "available"} params = {"status": "available"}
shares = self.shares_client.list_shares_with_detail(params) shares = self.shares_client.list_shares_with_detail(params)
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertEqual(params["status"], share["status"]) self.assertEqual(params["status"], share["status"])

View File

@ -21,7 +21,7 @@ from manila_tempest_tests.tests.api import base
class AvailabilityZonesTest(base.BaseSharesTest): class AvailabilityZonesTest(base.BaseSharesTest):
def _list_availability_zones_assertions(self, availability_zones): def _list_availability_zones_assertions(self, availability_zones):
self.assertTrue(len(availability_zones) > 0) self.assertGreater(len(availability_zones), 0)
keys = ("created_at", "updated_at", "name", "id") keys = ("created_at", "updated_at", "name", "id")
for az in availability_zones: for az in availability_zones:
self.assertEqual(len(keys), len(az)) self.assertEqual(len(keys), len(az))

View File

@ -94,8 +94,8 @@ class ShareNetworkListMixin(object):
for sn in listed: for sn in listed:
self.assertTrue(all(sn[key] == value for key, value in self.assertTrue(all(sn[key] == value for key, value in
six.iteritems(valid_filter_opts))) six.iteritems(valid_filter_opts)))
self.assertTrue(sn['created_at'] <= created_before) self.assertLessEqual(sn['created_at'], created_before)
self.assertTrue(sn['created_at'] >= created_since) self.assertGreaterEqual(sn['created_at'], created_since)
class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin): class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin):

View File

@ -255,7 +255,7 @@ class SharesActionsTest(base.BaseSharesTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertDictContainsSubset( self.assertDictContainsSubset(
filters['metadata'], share['metadata']) filters['metadata'], share['metadata'])
@ -271,7 +271,7 @@ class SharesActionsTest(base.BaseSharesTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertEqual(filters['host'], share['host']) self.assertEqual(filters['host'], share['host'])
@ -286,7 +286,7 @@ class SharesActionsTest(base.BaseSharesTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertEqual( self.assertEqual(
filters['share_network_id'], share['share_network_id']) filters['share_network_id'], share['share_network_id'])
@ -301,7 +301,7 @@ class SharesActionsTest(base.BaseSharesTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertEqual(filters['snapshot_id'], share['snapshot_id']) self.assertEqual(filters['snapshot_id'], share['snapshot_id'])
self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares]) self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares])
@ -314,7 +314,7 @@ class SharesActionsTest(base.BaseSharesTest):
shares = self.shares_client.list_shares_with_detail(params=filters) shares = self.shares_client.list_shares_with_detail(params=filters)
# verify response # verify response
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
sorted_list = [share['created_at'] for share in shares] sorted_list = [share['created_at'] for share in shares]
self.assertEqual(sorted(sorted_list), sorted_list) self.assertEqual(sorted(sorted_list), sorted_list)
@ -337,7 +337,7 @@ class SharesActionsTest(base.BaseSharesTest):
# list shares by active status, at least one share is expected # list shares by active status, at least one share is expected
params = {"status": "available"} params = {"status": "available"}
shares = self.shares_client.list_shares_with_detail(params) shares = self.shares_client.list_shares_with_detail(params)
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
for share in shares: for share in shares:
self.assertEqual(params["status"], share["status"]) self.assertEqual(params["status"], share["status"])
@ -353,7 +353,7 @@ class SharesActionsTest(base.BaseSharesTest):
# non-admin user can get shares only from his project # non-admin user can get shares only from his project
params = {"all_tenants": 1} params = {"all_tenants": 1}
shares = self.shares_client.list_shares_with_detail(params) shares = self.shares_client.list_shares_with_detail(params)
self.assertTrue(len(shares) > 0) self.assertGreater(len(shares), 0)
# get share with detailed info, we need its 'project_id' # get share with detailed info, we need its 'project_id'
share = self.shares_client.get_share(self.shares[0]["id"]) share = self.shares_client.get_share(self.shares[0]["id"])
@ -533,7 +533,7 @@ class SharesActionsTest(base.BaseSharesTest):
params=filters) params=filters)
# verify response # verify response
self.assertTrue(len(snaps) > 0) self.assertGreater(len(snaps), 0)
for snap in snaps: for snap in snaps:
self.assertEqual(filters['status'], snap['status']) self.assertEqual(filters['status'], snap['status'])
self.assertEqual(filters['name'], snap['name']) self.assertEqual(filters['name'], snap['name'])
@ -549,7 +549,7 @@ class SharesActionsTest(base.BaseSharesTest):
params=filters) params=filters)
# verify response # verify response
self.assertTrue(len(snaps) > 0) self.assertGreater(len(snaps), 0)
sorted_list = [snap['share_id'] for snap in snaps] sorted_list = [snap['share_id'] for snap in snaps]
self.assertEqual(sorted(sorted_list), sorted_list) self.assertEqual(sorted(sorted_list), sorted_list)