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

[DBOARD3-676]: Adding testing for mic

parent 6dc6fdc8
No related branches found
No related tags found
1 merge request!26Adding testing for mic
......@@ -52,12 +52,9 @@ ALL_DATA_SCHEMA = {
"type": "array",
"items": {"type": "string"}
},
"third_party_id": {
"type": "array",
"items": {"type": "string"}
}
"third_party_id": {"type": "string"}
},
"required": ["id", "sid", "status", "name", "service_type", "contacts", "planned_work_contacts","third_party_id"], # noqa E501
"required": ["id", "sid", "status", "name", "service_type", "contacts", "planned_work_contacts"], # noqa E501
"additionalProperties": False
}
}
......
......@@ -89,6 +89,14 @@ def test_extract_ims_data(mocker):
(111113, 'SID-03')
])
)
mocker.patch(
'inventory_provider.tasks.worker.ims_data.get_ids_and_third_party_ids',
return_value=(x for x in [
(111111, 'TPID-01'),
(111112, 'TPID-02'),
(111113, 'TPID-03')
])
)
mocker.patch(
'inventory_provider.tasks.worker.ims_data.lookup_geant_nodes',
return_value=[]
......@@ -149,6 +157,11 @@ def test_extract_ims_data(mocker):
111112: 'SID-02',
111113: 'SID-03'
}
assert res['circuit_ids_third_party_ids'] == {
111111: 'TPID-01',
111112: 'TPID-02',
111113: 'TPID-03'
}
def test_transform_ims_data():
......@@ -379,6 +392,11 @@ def test_transform_ims_data():
"circ_id_2": 'SID-02',
"circ_id_3": 'SID-03'
}
circuit_ids_third_party_ids = {
"sub_circuit_2": 'TPID-01',
"circ_id_2": 'TPID-02',
"circ_id_3": 'TPID-03'
}
flexils_data = {
702203: [
{
......@@ -410,6 +428,7 @@ def test_transform_ims_data():
"port_id_details": port_id_details,
"port_id_services": port_id_services,
"circuit_ids_sids": circuit_ids_and_sids,
"circuit_ids_third_party_ids": circuit_ids_third_party_ids,
"geant_nodes": ["eq_b"],
"flexils_data": flexils_data,
"customers": customers,
......@@ -538,7 +557,8 @@ def test_persist_ims_data(mocker, data_config, mocked_redis):
"sid": "SID-01",
"service_type": "type a",
"contacts": ["c1", "c2"],
"planned_work_contacts": ["c1"]
"planned_work_contacts": ["c1"],
"third_party_id": "I2-S13168 - RTSW.NEWY32AOA.NET.INTERNET2.EDU"
}
],
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment