diff --git a/test/test_worker.py b/test/test_worker.py index 6693e97117a3d867e1b8b96b93205df764f80316..7018c2c608d62afe9ea2e0a43777b704c8212537 100644 --- a/test/test_worker.py +++ b/test/test_worker.py @@ -21,9 +21,14 @@ def test_extract_ims_data(mocker): return_value=['lg router 1', 'lg router 2'] ) mocker.patch( - 'inventory_provider.tasks.worker.ims_data.get_customer_service_emails', + 'inventory_provider.tasks.worker.ims_data.get_customer_tts_contacts', return_value=[('123', 'CON A'), ('456', 'CON B')] ) + mocker.patch( + 'inventory_provider.tasks.worker.ims_data.' + 'get_customer_planned_work_contacts', + return_value=[('223', 'CON PW A'), ('556', 'CON PW B')] + ) mocker.patch( 'inventory_provider.tasks.worker.ims_data.get_monitored_circuit_ids', return_value=[123, 456, 789] @@ -80,6 +85,8 @@ def test_extract_ims_data(mocker): assert res['locations'] == {'loc_a': 'LOC A', 'loc_b': 'LOC B'} 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'} assert res['circuit_ids_to_monitor'] == [123, 456, 789] assert res['additional_circuit_customers'] == \ [ @@ -152,6 +159,11 @@ def test_transform_ims_data(): "cu_1_1": ["customer_1_1@a.org"] } + planned_work_contacts = { + "cu_1": ["customer_1_PW@a.org"], + "cu_1_1": ["customer_1_1_PW@a.org"] + } + port_id_details = { "port_id_1": [{ "equipment_name": "eq_a", @@ -320,6 +332,7 @@ def test_transform_ims_data(): data = { "locations": locations, "customer_contacts": customer_contacts, + "planned_work_contacts": planned_work_contacts, "circuit_ids_to_monitor": ["sub_circuit_2"], "additional_circuit_customers": additional_circuit_customer_ids, "hierarchy": hierarchy,