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
19084f34
Commit
19084f34
authored
3 months ago
by
Neda Moeini
Browse files
Options
Downloads
Patches
Plain Diff
Add unit test for VRF termination WF
parent
3f329f78
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!314
Feature/vrf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/workflows/vrf/test_terminate_vrf.py
+36
-0
36 additions, 0 deletions
test/workflows/vrf/test_terminate_vrf.py
with
36 additions
and
0 deletions
test/workflows/vrf/test_terminate_vrf.py
0 → 100644
+
36
−
0
View file @
19084f34
import
pytest
from
pydantic_forms.exceptions
import
FormValidationError
from
gso.products.product_types.router
import
Router
from
gso.products.product_types.vrf
import
VRF
from
test.workflows
import
assert_complete
,
extract_state
,
run_workflow
@pytest.mark.workflow
()
def
test_terminate_vrf_success
(
vrf_subscription_factory
,
faker
):
subscription_id
=
vrf_subscription_factory
()
initial_vrf_data
=
[{
"
subscription_id
"
:
subscription_id
},
{
"
tt_number
"
:
faker
.
tt_number
()}]
result
,
_
,
_
=
run_workflow
(
"
terminate_vrf
"
,
initial_vrf_data
)
assert_complete
(
result
)
state
=
extract_state
(
result
)
subscription_id
=
state
[
"
subscription_id
"
]
subscription
=
VRF
.
from_subscription
(
subscription_id
)
assert
subscription
.
status
==
"
terminated
"
@pytest.mark.workflow
()
def
test_terminate_vrf_with_router_list
(
vrf_subscription_factory
,
faker
,
router_subscription_factory
):
subscription_id
=
vrf_subscription_factory
()
subscription
=
VRF
.
from_subscription
(
subscription_id
)
router
=
Router
.
from_subscription
(
router_subscription_factory
())
subscription
.
vrf
.
vrf_router_list
=
[
router
.
router
]
subscription
.
save
()
initial_vrf_data
=
[{
"
subscription_id
"
:
subscription_id
},
{
"
tt_number
"
:
faker
.
tt_number
()}]
with
pytest
.
raises
(
FormValidationError
,
match
=
"
VRF must not have any routers assigned to it before it can be
"
"
deleted. Please remove all routers from the VRF first.
"
,
):
run_workflow
(
"
terminate_vrf
"
,
initial_vrf_data
)
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