Skip to content
Snippets Groups Projects

Add workflow for TWAMP deployment

Merged Karel van Klink requested to merge feature/add-twamp-workflow into develop
1 file
+ 38
0
Compare changes
  • Side-by-side
  • Inline
+ 38
0
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