Skip to content
Snippets Groups Projects
Commit c83861aa authored by Erik Reid's avatar Erik Reid
Browse files

lint+types

parent 3889a7db
No related branches found
No related tags found
No related merge requests found
import functools
import logging import logging
import re import re
from collections.abc import Generator from collections.abc import Generator
...@@ -54,7 +53,9 @@ def endpoint_equipment(endpoint: dict[str, Any]) -> str: ...@@ -54,7 +53,9 @@ def endpoint_equipment(endpoint: dict[str, Any]) -> str:
if 'hostname' in endpoint: if 'hostname' in endpoint:
return _hostname_to_equipment(endpoint['hostname']) return _hostname_to_equipment(endpoint['hostname'])
elif 'equipment' in endpoint: elif 'equipment' in endpoint:
return endpoint['equipment'] _name = endpoint['equipment']
assert isinstance(_name, str) # mypy noise
return _name
# should already be validated # should already be validated
raise AssertionError(f'no equipment or hostname in endpoint: {endpoint}') raise AssertionError(f'no equipment or hostname in endpoint: {endpoint}')
......
...@@ -76,7 +76,7 @@ def test_get_services(client, service_type): ...@@ -76,7 +76,7 @@ def test_get_services(client, service_type):
def test_get_unknown_service_type(client): def test_get_unknown_service_type(client):
rv = client.get(f"/map/services/BOGUS_SERVICE_TYPE") rv = client.get("/map/services/BOGUS_SERVICE_TYPE")
assert rv.status_code == 404 assert rv.status_code == 404
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment