Skip to content
Snippets Groups Projects
Commit 14a0182c authored by Neda Moeini's avatar Neda Moeini
Browse files

Test for VRF create WF

parent c0ff4217
No related branches found
No related tags found
1 merge request!314Feature/vrf
import pytest
from orchestrator.types import SubscriptionLifecycle
from gso.products import ProductName
from gso.products.product_types.vrf import VRF
from gso.services.subscriptions import get_product_id_by_name
from test.workflows import assert_complete, extract_state, run_workflow
@pytest.fixture()
def vrf_input(faker):
product_id = get_product_id_by_name(ProductName.VRF)
return [
{"product": product_id},
{
"tt_number": faker.tt_number(),
"partner": "GEANT",
"vrf_name": faker.pystr(),
"route_distinguisher": faker.pystr(),
"route_target": faker.pystr(),
"vrf_as_number": faker.pyint(),
},
{},
]
@pytest.mark.workflow()
def test_create_vrf_success(
vrf_input,
faker,
data_config_filename,
):
result, _, _ = run_workflow("create_vrf", vrf_input)
assert_complete(result)
state = extract_state(result)
subscription = VRF.from_subscription(state["subscription_id"])
assert subscription.status == SubscriptionLifecycle.ACTIVE
assert subscription.vrf.vrf_name == vrf_input[1]["vrf_name"]
assert subscription.vrf.route_distinguisher == vrf_input[1]["route_distinguisher"]
assert subscription.vrf.route_target == vrf_input[1]["route_target"]
assert subscription.vrf.vrf_as_number == vrf_input[1]["vrf_as_number"]
assert subscription.description == f"VRF {vrf_input[1]["vrf_name"]}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment