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

Initial update for the router model

parent 446e9581
Branches
No related tags found
No related merge requests found
......@@ -42,9 +42,9 @@ def _netbox_client_mock():
@pytest.fixture()
def input_form_wizard_data(router_subscription_factory, faker):
router_side_a = router_subscription_factory()
router_side_b = router_subscription_factory()
def input_form_wizard_data(nokia_router_subscription_factory, faker):
router_side_a = nokia_router_subscription_factory()
router_side_b = nokia_router_subscription_factory()
create_ip_trunk_step = {
"tt_number": faker.tt_number(),
......
......@@ -40,7 +40,7 @@ def test_migrate_iptrunk_success(
mock_provision_ip_trunk,
mock_migrate_ip_trunk,
iptrunk_subscription_factory,
router_subscription_factory,
nokia_router_subscription_factory,
faker,
data_config_filename: PathLike,
):
......@@ -57,7 +57,7 @@ def test_migrate_iptrunk_success(
product_id = iptrunk_subscription_factory()
old_subscription = Iptrunk.from_subscription(product_id)
new_router = router_subscription_factory()
new_router = nokia_router_subscription_factory()
# Run workflow
migrate_form_input = [
......
......@@ -4,8 +4,8 @@ import pytest
from infoblox_client import objects
from gso.products import ProductType, Site
from gso.products.product_blocks.router import RouterRole, RouterVendor
from gso.products.product_types.router import Router
from gso.products.product_blocks.router import RouterRole
from gso.products.product_types.router import Router, RouterVendor
from gso.services.crm import customer_selector, get_customer_by_name
from gso.services.subscriptions import get_product_id_by_name
from test.workflows import (
......@@ -27,7 +27,7 @@ def router_creation_input_form_data(site_subscription_factory, faker):
"router_site": router_site,
"hostname": faker.pystr(),
"ts_port": faker.pyint(),
"router_vendor": RouterVendor.NOKIA,
"vendor": RouterVendor.NOKIA,
"router_role": faker.random_choices(elements=(RouterRole.P, RouterRole.PE, RouterRole.AMT), length=1)[0],
"is_ias_connected": True,
}
......@@ -42,7 +42,7 @@ def router_creation_input_form_data(site_subscription_factory, faker):
@patch("gso.workflows.router.create_router.infoblox.allocate_v6_network")
@patch("gso.workflows.router.create_router.infoblox.allocate_v4_network")
@patch("gso.workflows.router.create_router.infoblox.allocate_host")
def test_create_router_success(
def test_create_nokia_router_success(
mock_allocate_host,
mock_allocate_v4_network,
mock_allocate_v6_network,
......@@ -56,7 +56,7 @@ def test_create_router_success(
data_config_filename,
):
# Set up mock return values
product_id = get_product_id_by_name(ProductType.ROUTER)
product_id = get_product_id_by_name(ProductType.NOKIA_ROUTER)
mock_site = Site.from_subscription(router_creation_input_form_data["router_site"]).site
mock_v4 = faker.ipv4()
mock_v4_net = faker.ipv4_network()
......@@ -132,7 +132,7 @@ def test_create_router_success(
@patch("gso.workflows.router.create_router.infoblox.allocate_v6_network")
@patch("gso.workflows.router.create_router.infoblox.allocate_v4_network")
@patch("gso.workflows.router.create_router.infoblox.allocate_host")
def test_create_router_lso_failure(
def test_create_nokia_router_lso_failure(
mock_allocate_host,
mock_allocate_v4_network,
mock_allocate_v6_network,
......@@ -181,7 +181,7 @@ def test_create_router_lso_failure(
)
# Run workflow
product_id = get_product_id_by_name(ProductType.ROUTER)
product_id = get_product_id_by_name(ProductType.NOKIA_ROUTER)
initial_router_data = [{"product": product_id}, router_creation_input_form_data]
result, process_stat, step_log = run_workflow("create_router", initial_router_data)
......
......@@ -24,12 +24,12 @@ def test_terminate_router_success(
mock_delete_host_by_ip,
mock_delete_device,
router_termination_input_form_data,
router_subscription_factory,
nokia_router_subscription_factory,
faker,
data_config_filename,
):
# Set up active subscription in database
product_id = router_subscription_factory()
product_id = nokia_router_subscription_factory()
# Run workflow
initial_router_data = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment