Skip to content
Snippets Groups Projects
Verified Commit db608735 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

add unit test for router activation workflow

parent 94dd80f3
No related branches found
No related tags found
1 merge request!165router creation flow update
Pipeline #85802 failed
This commit is part of merge request !165. Comments created here will be created in the context of that merge request.
import pytest
from gso.products import Router
from test.workflows import (
assert_complete,
extract_state,
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}, {"tt_number": faker.tt_number()}]
result, _, _ = run_workflow("activate_router", initial_input_data)
assert_complete(result)
state = extract_state(result)
subscription_id = state["subscription_id"]
subscription = Router.from_subscription(subscription_id)
assert subscription.status == "active"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment