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
Jira
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
Merge requests
!129
Add workflow for TWAMP deployment
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add workflow for TWAMP deployment
feature/add-twamp-workflow
into
develop
Overview
2
Commits
5
Pipelines
5
Changes
1
Merged
Karel van Klink
requested to merge
feature/add-twamp-workflow
into
develop
1 year ago
Overview
2
Commits
5
Pipelines
5
Changes
1
Expand
0
0
Merge request reports
Viewing commit
081ac9ab
Show latest version
1 file
+
38
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
081ac9ab
add unit test for TWAMP deployment workflow
· 081ac9ab
Karel van Klink
authored
1 year ago
test/workflows/iptrunk/test_deploy_twamp.py
0 → 100644
+
38
−
0
Options
from
unittest.mock
import
patch
import
pytest
from
gso.products
import
Iptrunk
from
test.workflows
import
(
assert_complete
,
assert_pp_interaction_success
,
extract_state
,
run_workflow
,
)
@pytest.mark.workflow
()
@patch
(
"
gso.workflows.iptrunk.deploy_twamp.execute_playbook
"
)
def
test_iptrunk_deploy_twamp_success
(
mock_execute_playbook
,
iptrunk_subscription_factory
,
faker
,
):
# Set up mock return values
product_id
=
iptrunk_subscription_factory
()
# Run workflow
initial_input_data
=
[{
"
subscription_id
"
:
product_id
},
{}]
result
,
process_stat
,
step_log
=
run_workflow
(
"
deploy_twamp
"
,
initial_input_data
)
for
_
in
range
(
2
):
result
,
step_log
=
assert_pp_interaction_success
(
result
,
process_stat
,
step_log
)
assert_complete
(
result
)
state
=
extract_state
(
result
)
subscription_id
=
state
[
"
subscription_id
"
]
subscription
=
Iptrunk
.
from_subscription
(
subscription_id
)
assert
subscription
.
status
==
"
active
"
assert
mock_execute_playbook
.
call_count
==
2
Loading