diff --git a/test/test_worker_utils.py b/test/test_worker_utils.py index 1d49ffed06556d3f09a472a3d50cdcf8e57f0364..12db770ae8f673e18179b3948bf5626d7ab9ea96 100644 --- a/test/test_worker_utils.py +++ b/test/test_worker_utils.py @@ -9,8 +9,7 @@ import jsonschema from inventory_provider.tasks import worker from inventory_provider.tasks import common -from inventory_provider.routes.msr import LOGICAL_SYSTEM_PEERING_LIST_SCHEMA - +from inventory_provider.routes import msr def backend_db(): return common._get_redis({ @@ -141,7 +140,7 @@ def test_build_juniper_peering_db(mocked_worker_module): "additionalProperties": False } - PEERING_LIST_SCHEMA = { + DETAILED_PEERING_LIST_SCHEMA = { "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "top-level-peering": TOP_LEVEL_PEERING_SCHEMA, @@ -194,15 +193,16 @@ def test_build_juniper_peering_db(mocked_worker_module): assert address == canonical continue - jsonschema.validate(value, PEERING_LIST_SCHEMA) + jsonschema.validate(value, DETAILED_PEERING_LIST_SCHEMA) if 'logical-system:' in key: - jsonschema.validate(value, LOGICAL_SYSTEM_PEERING_LIST_SCHEMA) + jsonschema.validate(value, msr.PEERING_LIST_SCHEMA) m = re.match(r'.*logical-system:(.+)$', key) assert all(p['logical-system'] == m.group(1) for p in value) found_logical_system = True if 'group:' in key: + jsonschema.validate(value, msr.PEERING_LIST_SCHEMA) m = re.match(r'.*group:(.+)$', key) assert all(p['group'] == m.group(1) for p in value) found_group = True