Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
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
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
3add3838
Commit
3add3838
authored
1 year ago
by
Hakan Calim
Browse files
Options
Downloads
Patches
Plain Diff
NAT-286: added test for delete device
parent
6e847069
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!89
Feature/nat 286 create unit tests for netbox client
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/services/test_netbox.py
+17
-0
17 additions, 0 deletions
test/services/test_netbox.py
with
17 additions
and
0 deletions
test/services/test_netbox.py
+
17
−
0
View file @
3add3838
...
@@ -219,3 +219,20 @@ def test_allocation_interface(mock_api, device, interface, data_config_filename:
...
@@ -219,3 +219,20 @@ def test_allocation_interface(mock_api, device, interface, data_config_filename:
assert
updated_interface
.
mark_connected
is
True
assert
updated_interface
.
mark_connected
is
True
mock_save
.
assert_called_once
()
mock_save
.
assert_called_once
()
@patch
(
"
gso.services.netbox_client.pynetbox.api
"
)
def
test_delete_device
(
mock_api
,
device
,
data_config_filename
:
PathLike
):
"""
Test a delete of a device
"""
# Mock netbox api
mock_api
.
return_value
.
dcim
.
devices
.
get
.
return_value
=
device
# mock delete method
mock_delete
=
Mock
()
device
.
delete
=
mock_delete
# Check delete of interface
NetboxClient
().
delete_device
(
device
.
name
)
mock_delete
.
assert_called_once
()
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