diff --git a/inventory_provider/db/opsdb.py b/inventory_provider/db/opsdb.py index 3074c856c3ee9ca3e4c54de769c653fe386c0869..91cffad1ed216ccab71747ad7f3f37a3cb7e5dc3 100644 --- a/inventory_provider/db/opsdb.py +++ b/inventory_provider/db/opsdb.py @@ -337,7 +337,10 @@ WHERE print(row) return { 'equipment name': row['router_name'], - 'type': 'INTERNAL' if row['pop_name'] in INTERNAL_POP_NAMES else 'CORE', + 'type': + 'INTERNAL' + if row['pop_name'] in INTERNAL_POP_NAMES + else 'CORE', 'pop': { 'name': row['pop_name'], 'city': row['pop_city'], diff --git a/inventory_provider/routes/lg.py b/inventory_provider/routes/lg.py index 90539e814038c77d6016fa5d631c2b5b777e3049..37dc49be90f49c865a4d7ac275e30883bc274377 100644 --- a/inventory_provider/routes/lg.py +++ b/inventory_provider/routes/lg.py @@ -1,5 +1,4 @@ import json -import re from flask import Blueprint, jsonify, Response diff --git a/test/test_lg_routes.py b/test/test_lg_routes.py index d83586aef2755f48b48de36ab63891bc12bfa7e2..e45e3b599bc0d4a2bc293e78ba95e01af9fb91e8 100644 --- a/test/test_lg_routes.py +++ b/test/test_lg_routes.py @@ -66,6 +66,7 @@ def test_public_routers(client): # no internal routers should be present assert all(r['type'] == 'CORE' for r in response_data) + def test_internal_routers(client): rv = client.get( '/lg/routers/all', @@ -82,7 +83,6 @@ def test_internal_routers(client): assert any(r['type'] == 'CORE' for r in response_data) - @pytest.mark.parametrize('bad_endpoint', [ # bad access param keyword @@ -99,7 +99,7 @@ def test_internal_routers(client): '/lg/', '/lg/something' ]) -def test_internal_routers(client, bad_endpoint): +def test_bad_endpoints(client, bad_endpoint): rv = client.get( bad_endpoint, headers=DEFAULT_REQUEST_HEADERS)