Skip to content
Snippets Groups Projects
Commit 93bc746a authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

flake8 and fix test in test_worker.py

parent d87c0ec5
Branches
Tags
No related merge requests found
......@@ -120,11 +120,13 @@ class BRIAN_DASHBOARDS(Enum):
# NREN customer
NREN = auto()
class PORT_TYPES(Enum):
ACCESS = auto()
SERVICE = auto()
UNKNOWN = auto()
# only used in INTERFACE_LIST_SCHEMA and sphinx docs
_DASHBOARD_IDS = [d.name for d in list(BRIAN_DASHBOARDS)]
......
......@@ -102,7 +102,7 @@ def test_extract_ims_data(mocker):
assert res['lg_routers'] == ['lg router 1', 'lg router 2']
assert res['customer_contacts'] == {'123': 'CON A', '456': 'CON B'}
assert res['planned_work_contacts'] == \
{'223': 'CON PW A', '556': 'CON PW B'}
{'223': 'CON PW A', '556': 'CON PW B'}
assert res['circuit_ids_to_monitor'] == [123, 456, 789]
assert res['additional_circuit_customers'] == \
[
......@@ -113,7 +113,7 @@ def test_extract_ims_data(mocker):
]
},
{'id b': [{'id': 'B', 'name': 'customer b'}]}
]
]
assert res['hierarchy'] == {
'1': {'id': '1', 'value': 'A'},
'2': {'id': '2', 'value': 'B'}
......@@ -246,7 +246,7 @@ def test_transform_ims_data():
"status": "operational",
"port_a_id": "port_id_3",
"port_b_id": "port_id_4",
}
}
],
"port_id_4": [
{
......@@ -600,7 +600,7 @@ def test_populate_poller_interfaces_cache(
"name": "ae_a",
"bundle": [],
"bundle-parents": [],
"description": "DESCRIPTION B",
"description": "DESCRIPTION B $GA-0001",
"circuits": []
},
{
......@@ -616,7 +616,7 @@ def test_populate_poller_interfaces_cache(
"name": "lab_interface_a",
"bundle": ["ae_c"],
"bundle-parents": [],
"description": "DESCRIPTION C",
"description": "DESCRIPTION C $GA-0001",
"circuits": []
},
{
......@@ -624,7 +624,7 @@ def test_populate_poller_interfaces_cache(
"name": "ae_c",
"bundle": [],
"bundle-parents": [],
"description": "DESCRIPTION D",
"description": "DESCRIPTION D $GS-0001",
"circuits": []
},
]
......@@ -690,43 +690,45 @@ def test_populate_poller_interfaces_cache(
}
}
}
no_lab_res = [
{
"router": "router_a.geant.net",
"name": "interface_a",
"bundle": ["ae_a"],
"bundle-parents": [],
"description": "DESCRIPTION A",
"circuits": [],
"snmp-index": 12,
"dashboards": []
'router': 'router_a.geant.net',
'name': 'interface_a',
'bundle': ['ae_a'],
'bundle-parents': [],
'description': 'DESCRIPTION A',
'circuits': [],
'port_type': 'UNKNOWN',
'snmp-index': 12,
'dashboards': []
},
{
"router": "router_a.geant.net",
"name": "ae_a",
"bundle": [],
"bundle-parents": ["interface_a"],
"description": "DESCRIPTION B",
"circuits": [],
"snmp-index": 1,
"dashboards": []
'router': 'router_a.geant.net',
'name': 'ae_a',
'bundle': [],
'bundle-parents': ['interface_a'],
'description': 'DESCRIPTION B $GA-0001',
'circuits': [],
'port_type': 'ACCESS',
'snmp-index': 1,
'dashboards': []
},
{
"router": "router_a.geant.net",
"name": "ae_a.123",
"bundle": [],
"bundle-parents": ["interface_a"],
"description": "DESCRIPTION C",
"circuits": [{
"id": 321,
"name": "SERVICE A",
"type": "SERVICE TYPE",
"status": "operational"
'router': 'router_a.geant.net',
'name': 'ae_a.123',
'bundle': [],
'bundle-parents': ['interface_a'],
'description': 'DESCRIPTION C',
'circuits': [{
'id': 321,
'name': 'SERVICE A',
'type': 'SERVICE TYPE',
'status': 'operational'
}],
"snmp-index": 1231,
"dashboards": []
},
'port_type': 'UNKNOWN',
'snmp-index': 1231,
'dashboards': []
}
]
lab_res = [
{
......@@ -734,11 +736,12 @@ def test_populate_poller_interfaces_cache(
"name": "ae_c",
"bundle": [],
"bundle-parents": ["lab_interface_a"],
"description": "DESCRIPTION D",
"description": "DESCRIPTION D $GS-0001",
"circuits": [],
"snmp-index": 3,
"dashboards": []
},
"dashboards": [],
"port_type": "SERVICE"
}
]
for k in r.keys("lab:netconf-interfaces-hosts:*"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment