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
8c914c25
Commit
8c914c25
authored
5 years ago
by
Robert Latta
Browse files
Options
Downloads
Patches
Plain Diff
added test for get_top_level_services
parent
3a9a2725
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_classifier_utilities.py
+19
-0
19 additions, 0 deletions
test/test_classifier_utilities.py
with
19 additions
and
0 deletions
test/test_classifier_utilities.py
+
19
−
0
View file @
8c914c25
import
pytest
from
inventory_provider.routes
import
classifier
from
inventory_provider.routes.classifier
import
get_top_level_services
from
inventory_provider.tasks
import
common
@pytest.mark.parametrize
(
'
interface_name,base_name
'
,
[
(
'
ae0
'
,
'
ae0
'
),
...
...
@@ -19,3 +22,19 @@ from inventory_provider.routes import classifier
)
def
test_base_interface_name
(
interface_name
,
base_name
):
assert
classifier
.
base_interface_name
(
interface_name
)
==
base_name
# todo - not too keen on this as it relies on the extracted opsdb data, which
# could change and lead to this test failing
def
test_get_top_level_circuits
(
mocked_redis
):
config
=
{
'
redis-databases
'
:
'
xxx
'
,
'
redis
'
:
{
'
hostname
'
:
'
host
'
,
'
port
'
:
1234
}
}
r
=
common
.
get_current_redis
(
config
)
tls
=
get_top_level_services
(
47141
,
r
)
assert
len
(
tls
)
==
1
assert
tls
[
0
][
'
name
'
]
==
'
LON2-PAR 300G TRUNK
'
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