Skip to content
Snippets Groups Projects

router creation flow update

Merged Karel van Klink requested to merge feature/update-lifecycle-states into develop
6 files
+ 25
1
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 36
0
import pytest
from gso.products import Router
from test.workflows import (
assert_complete,
assert_suspended,
extract_state,
resume_workflow,
run_workflow,
)
@pytest.mark.workflow()
def test_activate_router_success(
nokia_router_subscription_factory,
faker,
):
# Set up mock return values
product_id = nokia_router_subscription_factory(status="provisioning")
# Sanity check
assert Router.from_subscription(product_id).status == "provisioning"
# Run workflow
initial_input_data = [{"subscription_id": product_id}, {}]
result, process_stat, step_log = run_workflow("activate_router", initial_input_data)
assert_suspended(result)
result, step_log = resume_workflow(process_stat, step_log, input_data=[{"checklist_url": "http://localhost"}])
assert_complete(result)
state = extract_state(result)
subscription_id = state["subscription_id"]
subscription = Router.from_subscription(subscription_id)
assert subscription.status == "active"
Loading