diff --git a/src/reporter/tests/test_notify.py b/src/reporter/tests/test_notify.py index 92e0ed11..049bcbbf 100644 --- a/src/reporter/tests/test_notify.py +++ b/src/reporter/tests/test_notify.py @@ -267,7 +267,7 @@ def test_integration_multiple_entities(diffEntityWithDifferentAttrs, orion_clien assert r.status_code == 200 entities = r.json() assert len(entities) == 3 - delete_entity_type("service", diffEntityWithDifferentAttrs[0]['type']) + delete_entity_type("service", diffEntityWithDifferentAttrs[0]['type'], "/Root") @pytest.mark.skip(reason="See issue #105") @pytest.mark.parametrize("service", services) @@ -327,7 +327,7 @@ def test_multiple_data_elements(service, notification, diffEntityWithDifferentAt r = requests.get(entities_url, params=None, headers=query_header(service)) entities = r.json() assert len(entities) == 3 - delete_entity_type(None, diffEntityWithDifferentAttrs[0]['type']) + delete_entity_type(service, diffEntityWithDifferentAttrs[0]['type']) @pytest.mark.parametrize("service", services) @@ -376,7 +376,7 @@ def test_multiple_data_elements_different_servicepath(service, notification, dif r = requests.get(entities_url, params=None, headers=query_headers) entities = r.json() assert len(entities) == 3 - delete_entity_type(service, diffEntityWithDifferentAttrs[0]['type']) + delete_entity_type(service, diffEntityWithDifferentAttrs[0]['type'], '/Test') @pytest.mark.parametrize("service", services) diff --git a/src/reporter/tests/utils.py b/src/reporter/tests/utils.py index b2df17e1..124ae97a 100644 --- a/src/reporter/tests/utils.py +++ b/src/reporter/tests/utils.py @@ -84,10 +84,13 @@ def insert_test_data(service, entity_types, n_entities=1, index_size=30, time.sleep(1) -def delete_entity_type(service, entity_type): +def delete_entity_type(service, entity_type, service_path=None): h = {} if service: - h = {'Fiware-Service': service} + h['Fiware-Service'] = service + if service_path: + h['Fiware-ServicePath'] = service_path + url = '{}/types/{}'.format(QL_URL, entity_type) r = requests.delete(url, headers=h)