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

Split duplicate code into a new fixture

parent 69de1d55
No related branches found
No related tags found
1 merge request!286Add Edge Port, GÉANT IP and IAS products
Pipeline #89881 failed
......@@ -92,15 +92,10 @@ def test_modify_nren_l3_core_service_add_new_edge_port_success(
assert len(subscription.nren_l3_core_service.nren_ap_list) == 3
@pytest.mark.parametrize("l3_core_service_type", [NRENL3CoreServiceType.GEANT_IP, NRENL3CoreServiceType.IAS])
@pytest.mark.workflow()
def test_modify_nren_l3_core_service_modify_edge_port_success(
faker, nren_l3_core_service_subscription_factory, l3_core_service_type
):
subscription_id = nren_l3_core_service_subscription_factory(nren_l3_core_service_type=l3_core_service_type)
subscription = NRENL3CoreService.from_subscription(subscription_id)
new_sbp_data = [
{
@pytest.fixture()
def sbp_input_form_data(faker):
def _generate_form_data():
return {
"geant_sid": faker.geant_sid(),
"is_tagged": True,
"vlan_id": faker.vlan_id(),
......@@ -131,41 +126,19 @@ def test_modify_nren_l3_core_service_modify_edge_port_success(
"peer_address": faker.ipv6(),
"add_v6_multicast": True,
},
},
{
"geant_sid": faker.geant_sid(),
"is_tagged": True,
"vlan_id": faker.vlan_id(),
"ipv4_address": faker.ipv4(),
"ipv6_address": faker.ipv6(),
"custom_firewall_filters": True,
"v4_bgp_peer": {
"bfd_enabled": True,
"bfd_interval": faker.pyint(),
"bfd_multiplier": faker.pyint(),
"has_custom_policies": True,
"authentication_key": faker.password(),
"multipath_enabled": True,
"send_default_route": True,
"is_passive": True,
"peer_address": faker.ipv4(),
"add_v4_multicast": True,
},
"v6_bgp_peer": {
"bfd_enabled": True,
"bfd_interval": faker.pyint(),
"bfd_multiplier": faker.pyint(),
"has_custom_policies": True,
"authentication_key": faker.password(),
"multipath_enabled": True,
"send_default_route": True,
"is_passive": True,
"peer_address": faker.ipv6(),
"add_v6_multicast": True,
},
},
]
}
return _generate_form_data
@pytest.mark.parametrize("l3_core_service_type", [NRENL3CoreServiceType.GEANT_IP, NRENL3CoreServiceType.IAS])
@pytest.mark.workflow()
def test_modify_nren_l3_core_service_modify_edge_port_success(
faker, nren_l3_core_service_subscription_factory, l3_core_service_type, sbp_input_form_data
):
subscription_id = nren_l3_core_service_subscription_factory(nren_l3_core_service_type=l3_core_service_type)
subscription = NRENL3CoreService.from_subscription(subscription_id)
new_sbp_data = [sbp_input_form_data(), sbp_input_form_data()]
input_form_data = [
{"subscription_id": subscription_id},
{
......
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