use 'true' and 'false' instead of magic num

Change-Id: I29282661cd3efc735bc9c12f771d13d0d3fcc9a2
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
This commit is contained in:
dongwenjuan 2017-02-09 16:42:57 +08:00
parent 86dab827f9
commit 705e1a91ec
10 changed files with 21 additions and 21 deletions

@ -118,7 +118,7 @@ class BaseApiTest(base.BaseTestCase):
return volume
def _get_host(self):
topology = self.vitrage_client.topology.get(all_tenants=1)
topology = self.vitrage_client.topology.get(all_tenants=True)
host = filter(lambda item: item[VProps.TYPE] == NOVA_HOST_DATASOURCE,
topology['nodes'])
return host[0]

@ -38,7 +38,7 @@ class TestAodhAlarm(BaseAlarmsTest):
self._create_ceilometer_alarm(self._find_instance_resource_id())
# Calculate expected results
api_graph = self.vitrage_client.topology.get(all_tenants=1)
api_graph = self.vitrage_client.topology.get(all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,
@ -73,7 +73,7 @@ class TestAodhAlarm(BaseAlarmsTest):
self._create_ceilometer_alarm()
# Calculate expected results
api_graph = self.vitrage_client.topology.get(all_tenants=1)
api_graph = self.vitrage_client.topology.get(all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,

@ -37,7 +37,7 @@ class TestCinderVolume(BaseTopologyTest):
num_volumes=self.NUM_VOLUME)
# Calculate expected results
api_graph = self.vitrage_client.topology.get(all_tenants=1)
api_graph = self.vitrage_client.topology.get(all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,

@ -42,7 +42,7 @@ class TestHeatStack(BaseTopologyTest):
self._create_stacks(num_stacks=self.NUM_STACKS)
# Calculate expected results
api_graph = self.vitrage_client.topology.get(all_tenants=1)
api_graph = self.vitrage_client.topology.get(all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,

@ -43,7 +43,7 @@ class TestNeutron(BaseTopologyTest):
set_public_network=True)
# Calculate expected results
api_graph = self.vitrage_client.topology.get(all_tenants=1)
api_graph = self.vitrage_client.topology.get(all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,

@ -35,7 +35,7 @@ class TestNova(BaseTopologyTest):
self._create_entities(num_instances=self.NUM_INSTANCE)
# Calculate expected results
api_graph = self.vitrage_client.topology.get(all_tenants=1)
api_graph = self.vitrage_client.topology.get(all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,

@ -39,7 +39,7 @@ class TestStaticPhysical(BaseApiTest):
self._create_switches()
# Calculate expected results
api_graph = self.vitrage_client.topology.get(all_tenants=1)
api_graph = self.vitrage_client.topology.get(all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,

@ -128,7 +128,7 @@ class TestRca(BaseRcaTest):
self._create_alarm(
resource_id=self._get_hostname(),
alarm_name=RCA_ALARM_NAME)
topology = self.vitrage_client.topology.get(all_tenants=1)
topology = self.vitrage_client.topology.get(all_tenants=True)
self._validate_set_state(topology=topology['nodes'],
instances=instances)

@ -36,7 +36,7 @@ class BaseTopologyTest(BaseApiTest):
api_graph = self.vitrage_client.topology.get(
limit=4,
root='RESOURCE:openstack.cluster:OpenStack Cluster',
all_tenants=1)
all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data()
num_default_entities = self.num_default_entities + \

@ -67,7 +67,7 @@ class TestTopology(BaseTopologyTest):
num_volumes=self.NUM_VOLUME)
# Calculate expected results
api_graph = self.vitrage_client.topology.get(all_tenants=1)
api_graph = self.vitrage_client.topology.get(all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,
@ -109,7 +109,7 @@ class TestTopology(BaseTopologyTest):
# Calculate expected results
api_graph = self.vitrage_client.topology.get(
query=self._graph_query(),
all_tenants=1)
all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,
@ -144,7 +144,7 @@ class TestTopology(BaseTopologyTest):
# Calculate expected results
api_graph = self.vitrage_client.topology.get(
graph_type='tree', query=NOVA_QUERY, all_tenants=1)
graph_type='tree', query=NOVA_QUERY, all_tenants=True)
graph = self._create_graph_from_tree_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,
@ -179,7 +179,7 @@ class TestTopology(BaseTopologyTest):
# Calculate expected results
api_graph = self.vitrage_client.topology.get(
graph_type='tree', query=self._tree_query(), all_tenants=1)
graph_type='tree', query=self._tree_query(), all_tenants=True)
graph = self._create_graph_from_tree_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1, host_edges=1)
@ -209,7 +209,7 @@ class TestTopology(BaseTopologyTest):
# Calculate expected results
api_graph = self.vitrage_client.topology.get(
limit=2, graph_type='tree', query=NOVA_QUERY, all_tenants=1)
limit=2, graph_type='tree', query=NOVA_QUERY, all_tenants=True)
graph = self._create_graph_from_tree_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1, host_edges=1)
@ -239,7 +239,7 @@ class TestTopology(BaseTopologyTest):
# Calculate expected results
api_graph = self.vitrage_client.topology.get(
limit=3, graph_type='tree', query=NOVA_QUERY, all_tenants=1)
limit=3, graph_type='tree', query=NOVA_QUERY, all_tenants=True)
graph = self._create_graph_from_tree_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,
@ -277,7 +277,7 @@ class TestTopology(BaseTopologyTest):
api_graph = self.vitrage_client.topology.get(
limit=2,
root='RESOURCE:openstack.cluster:OpenStack Cluster',
all_tenants=1)
all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1, host_edges=1)
@ -310,7 +310,7 @@ class TestTopology(BaseTopologyTest):
api_graph = self.vitrage_client.topology.get(
limit=3,
root='RESOURCE:openstack.cluster:OpenStack Cluster',
all_tenants=1)
all_tenants=True)
graph = self._create_graph_from_graph_dictionary(api_graph)
entities = self._entities_validation_data(
host_entities=1,
@ -348,7 +348,7 @@ class TestTopology(BaseTopologyTest):
self.vitrage_client.topology.get(
limit=2,
root='RESOURCE:openstack.cluster:OpenStack Cluster',
all_tenants=1)
all_tenants=True)
except ClientException as e:
self.assertEqual(403, e.code)
self.assertEqual(
@ -372,7 +372,7 @@ class TestTopology(BaseTopologyTest):
# Calculate expected results
api_graph = self.vitrage_client.topology.get(
query=self._graph_no_match_query(), all_tenants=1)
query=self._graph_no_match_query(), all_tenants=True)
# Test Assertions
self.assertEqual(
@ -403,7 +403,7 @@ class TestTopology(BaseTopologyTest):
api_graph = self.vitrage_client.topology.get(
graph_type='tree',
query=self._tree_no_match_query(),
all_tenants=1)
all_tenants=True)
# Test Assertions
self.assertEqual({}, api_graph)