Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-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
dashboardv3
inventory-provider
Commits
7ec48d2a
Commit
7ec48d2a
authored
2 years ago
by
Sam Roberts
Browse files
Options
Downloads
Patches
Plain Diff
endpoint tested correctly from existing test data with good coverage
parent
c78cd1a9
No related branches found
No related tags found
1 merge request
!1
Feature/reporting 297 msr mdvpn endpoint
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/conftest.py
+3
-3
3 additions, 3 deletions
test/conftest.py
test/test_msr_routes.py
+14
-1
14 additions, 1 deletion
test/test_msr_routes.py
with
17 additions
and
4 deletions
test/conftest.py
+
3
−
3
View file @
7ec48d2a
...
...
@@ -67,9 +67,9 @@ def data_config_filename():
],
'
gws-direct
'
:
{},
'
nren-asn-map
'
:
{
"
1
0
0
"
:
"
BogusNREN
"
,
"
20
0
"
:
"
FoobarNREN
"
,
"
3
00
"
:
"
A
lsoNE
T
"
"
1
93
0
"
:
"
FOO
"
,
"
68
0
"
:
"
BAR
"
,
"
22
00
"
:
"
B
AT
"
}
}
...
...
This diff is collapsed.
Click to expand it.
test/test_msr_routes.py
+
14
−
1
View file @
7ec48d2a
...
...
@@ -5,7 +5,8 @@ import pytest
from
inventory_provider.routes.msr
import
PEERING_LIST_SCHEMA
,
\
PEERING_GROUP_LIST_SCHEMA
,
PEERING_ADDRESS_SERVICES_LIST
,
\
SYSTEM_CORRELATION_SERVICES_LIST_SCHEMA
,
_get_services_for_address
SYSTEM_CORRELATION_SERVICES_LIST_SCHEMA
,
_get_services_for_address
,
\
MDVPN_LIST_SCHEMA
from
inventory_provider.routes.poller
import
SERVICES_LIST_SCHEMA
from
inventory_provider.tasks.common
import
_get_redis
...
...
@@ -321,3 +322,15 @@ def test_get_all_peerings(client):
response_data
=
json
.
loads
(
rv
.
data
.
decode
(
'
utf-8
'
))
jsonschema
.
validate
(
response_data
,
PEERING_LIST_SCHEMA
)
assert
response_data
# test data is non-empty
def
test_get_mdvpn_peerings
(
client
,
mocked_redis
):
rv
=
client
.
get
(
'
/msr/mdvpn
'
,
headers
=
DEFAULT_REQUEST_HEADERS
)
assert
rv
.
status_code
==
200
assert
rv
.
is_json
response_data
=
json
.
loads
(
rv
.
data
.
decode
(
'
utf-8
'
))
jsonschema
.
validate
(
response_data
,
MDVPN_LIST_SCHEMA
)
assert
response_data
# test data is non-empty
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