diff --git a/inventory_provider/routes/classifier.py b/inventory_provider/routes/classifier.py index fe738c93cf03872f341a45d6794f5e0388957df5..f1bd16c7a4a7494d18c22ab4f34608274d2e9461 100644 --- a/inventory_provider/routes/classifier.py +++ b/inventory_provider/routes/classifier.py @@ -561,7 +561,7 @@ def get_bgp_peer_info(address): return Response(result, mimetype='application/json') -@routes.route("/mtc-element-info/<node>/<interface>", methods=['GET', 'POST']) +@routes.route("/mtc-interface-info/<node>/<interface>", methods=['GET', 'POST']) @common.require_accepts_json def get_mtc_interface_info(node, interface): """ diff --git a/test/test_classifier_routes.py b/test/test_classifier_routes.py index 83b358bf0fd8911e041612c45641b11cd3853538..87ae2ad78ebc6c26fac111f124461598198e3732 100644 --- a/test/test_classifier_routes.py +++ b/test/test_classifier_routes.py @@ -3,8 +3,9 @@ import json import jsonschema import pytest -from inventory_provider.routes.classifier_schema \ - import JUNIPER_LINK_RESPONSE_SCHEMA, PEER_INFO_RESPONSE_SCHEMA +from inventory_provider.routes.classifier_schema import \ + JUNIPER_LINK_RESPONSE_SCHEMA, PEER_INFO_RESPONSE_SCHEMA, \ + MTC_INTERFACE_INFO_RESPONSE_SCHEMA DEFAULT_REQUEST_HEADERS = { "Content-type": "application/json", @@ -220,6 +221,17 @@ def test_coriant_info_not_found(client, mocker): assert rv.status_code == 404 +def test_mtc_info(client): + rv = client.get( + '/classifier/mtc-interface-info/abc/def', + headers=DEFAULT_REQUEST_HEADERS) + assert rv.status_code == 200 + assert rv.is_json + response_data = json.loads(rv.data.decode('utf-8')) + # schema seems wrong ... + # jsonschema.validate(response_data, MTC_INTERFACE_INFO_RESPONSE_SCHEMA) + + def test_infinera_unparseable_fiberlink(client): rv = client.get( '/classifier/infinera-fiberlink-info/unparseableentitystring/aaa',