Skip to content
Snippets Groups Projects
Commit dfbc6fad authored by Saket Agrahari's avatar Saket Agrahari
Browse files

correcting the test case scenario

parent ac8c2ed1
No related branches found
No related tags found
No related merge requests found
......@@ -388,7 +388,7 @@ def get_node_locations(ds: IMS):
pass # no alias - ignore silently
for node in site['nodes']:
if node['inventorystatusid'] in STATUSES_TO_IGNORE:
if node['inventorystatusid'] != InventoryStatus.IN_SERVICE.value:
continue
yield (node['name'], {
......@@ -439,7 +439,7 @@ def lookup_lg_routers(ds: IMS):
def _matching_node(node_):
# [LG-46]
if InventoryStatus(node_['inventorystatusid']) \
!= InventoryStatus.IN_SERVICE.value:
!= InventoryStatus.IN_SERVICE:
return False
if pattern.match(node_['name']):
......@@ -464,7 +464,7 @@ def lookup_lg_routers(ds: IMS):
for node in nodes:
if not _matching_node(node):
continue
if node['inventorystatusid'] in STATUSES_TO_IGNORE:
if node['inventorystatusid'] != InventoryStatus.IN_SERVICE.value:
continue
site = ds.get_entity_by_id('Site', node['siteid'], site_nav_props,
......
......@@ -266,8 +266,8 @@ def test_lookup_lg_routers(mocker):
'Name like MX',
inventory_provider.db.ims.EQUIP_DEF_PROPERTIES['Nodes'])
assert ds.get_entity_by_id.call_count == 36
assert len(res) == 36
assert ds.get_entity_by_id.call_count == 35
assert len(res) == 35
pop = {
'name': 'pop name',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment