Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mapping Provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
Next Generation Map
Mapping Provider
Commits
c83861aa
Commit
c83861aa
authored
3 weeks ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
lint+types
parent
3889a7db
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mapping_provider/backends/services.py
+3
-2
3 additions, 2 deletions
mapping_provider/backends/services.py
test/test_map_endpoints.py
+1
-1
1 addition, 1 deletion
test/test_map_endpoints.py
with
4 additions
and
3 deletions
mapping_provider/backends/services.py
+
3
−
2
View file @
c83861aa
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
}
'
)
...
...
This diff is collapsed.
Click to expand it.
test/test_map_endpoints.py
+
1
−
1
View file @
c83861aa
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment