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
660f6c85
Commit
660f6c85
authored
3 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
added meaningless mtc endpoint test
parent
9e318382
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inventory_provider/routes/classifier.py
+1
-1
1 addition, 1 deletion
inventory_provider/routes/classifier.py
test/test_classifier_routes.py
+14
-2
14 additions, 2 deletions
test/test_classifier_routes.py
with
15 additions
and
3 deletions
inventory_provider/routes/classifier.py
+
1
−
1
View file @
660f6c85
...
@@ -561,7 +561,7 @@ def get_bgp_peer_info(address):
...
@@ -561,7 +561,7 @@ def get_bgp_peer_info(address):
return
Response
(
result
,
mimetype
=
'
application/json
'
)
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
@common.require_accepts_json
def
get_mtc_interface_info
(
node
,
interface
):
def
get_mtc_interface_info
(
node
,
interface
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
test/test_classifier_routes.py
+
14
−
2
View file @
660f6c85
...
@@ -3,8 +3,9 @@ import json
...
@@ -3,8 +3,9 @@ import json
import
jsonschema
import
jsonschema
import
pytest
import
pytest
from
inventory_provider.routes.classifier_schema
\
from
inventory_provider.routes.classifier_schema
import
\
import
JUNIPER_LINK_RESPONSE_SCHEMA
,
PEER_INFO_RESPONSE_SCHEMA
JUNIPER_LINK_RESPONSE_SCHEMA
,
PEER_INFO_RESPONSE_SCHEMA
,
\
MTC_INTERFACE_INFO_RESPONSE_SCHEMA
DEFAULT_REQUEST_HEADERS
=
{
DEFAULT_REQUEST_HEADERS
=
{
"
Content-type
"
:
"
application/json
"
,
"
Content-type
"
:
"
application/json
"
,
...
@@ -220,6 +221,17 @@ def test_coriant_info_not_found(client, mocker):
...
@@ -220,6 +221,17 @@ def test_coriant_info_not_found(client, mocker):
assert
rv
.
status_code
==
404
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
):
def
test_infinera_unparseable_fiberlink
(
client
):
rv
=
client
.
get
(
rv
=
client
.
get
(
'
/classifier/infinera-fiberlink-info/unparseableentitystring/aaa
'
,
'
/classifier/infinera-fiberlink-info/unparseableentitystring/aaa
'
,
...
...
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