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

Add unit test for GÉANT IP migration

parent 6b0eb794
Branches
Tags
1 merge request!286Add Edge Port, GÉANT IP and IAS products
This commit is part of merge request !286. Comments created here will be created in the context of that merge request.
......@@ -13,6 +13,7 @@ Submodules
:titlesonly:
create_geant_ip
modify_geant_ip
create_imported_geant_ip
import_geant_ip
migrate_geant_ip
modify_geant_ip
``gso.workflows.geant_ip.migrate_geant_ip``
===========================================
.. automodule:: gso.workflows.geant_ip.migrate_geant_ip
:members:
:show-inheritance:
import pytest
from gso.products.product_types.geant_ip import GeantIP
from test.workflows import assert_complete, extract_state, run_workflow
@pytest.mark.workflow()
def test_migrate_geant_ip_success(
faker, edge_port_subscription_factory, partner_factory, geant_ip_subscription_factory
):
partner = partner_factory()
subscription_id = geant_ip_subscription_factory(partner=partner)
new_edge_port_1 = edge_port_subscription_factory(partner=partner)
new_edge_port_2 = edge_port_subscription_factory(partner=partner)
subscription = GeantIP.from_subscription(subscription_id)
form_input_data = [
{"subscription_id": subscription_id},
{
"tt_number": faker.tt_number(),
"edge_port_selection": [
{
"old_edge_port": subscription.geant_ip.geant_ip_ap_list[0].geant_ip_sbp.edge_port.description,
"new_edge_port": new_edge_port_1,
},
{
"old_edge_port": subscription.geant_ip.geant_ip_ap_list[1].geant_ip_sbp.edge_port.description,
"new_edge_port": new_edge_port_2,
},
],
},
]
result, _, _ = run_workflow("migrate_geant_ip", form_input_data)
assert_complete(result)
state = extract_state(result)
subscription = GeantIP.from_subscription(state["subscription_id"])
assert subscription.insync
assert len(subscription.geant_ip.geant_ip_ap_list) == 2
assert (
str(subscription.geant_ip.geant_ip_ap_list[0].geant_ip_sbp.edge_port.owner_subscription_id) == new_edge_port_1
)
assert (
str(subscription.geant_ip.geant_ip_ap_list[1].geant_ip_sbp.edge_port.owner_subscription_id) == new_edge_port_2
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment