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

Update unit tests

parent 5303aaf5
Branches
Tags
1 merge request!244remove Kentik steps from router creation and termination workflows
Pipeline #88212 canceled
...@@ -42,9 +42,7 @@ def router_creation_input_form_data(site_subscription_factory, faker): ...@@ -42,9 +42,7 @@ def router_creation_input_form_data(site_subscription_factory, faker):
@patch("gso.workflows.router.create_router.infoblox.find_host_by_fqdn") @patch("gso.workflows.router.create_router.infoblox.find_host_by_fqdn")
@patch("gso.workflows.router.create_router.infoblox.allocate_host") @patch("gso.workflows.router.create_router.infoblox.allocate_host")
@patch("gso.workflows.router.create_router.SharePointClient") @patch("gso.workflows.router.create_router.SharePointClient")
@patch("gso.workflows.router.create_router.KentikClient")
def test_create_nokia_router_success( def test_create_nokia_router_success(
mock_kentik_client,
mock_sharepoint_client, mock_sharepoint_client,
mock_allocate_host, mock_allocate_host,
mock_find_host_by_fqdn, mock_find_host_by_fqdn,
...@@ -115,7 +113,6 @@ def test_create_nokia_router_success( ...@@ -115,7 +113,6 @@ def test_create_nokia_router_success(
assert mock_netbox_create_device.call_count == 1 assert mock_netbox_create_device.call_count == 1
assert mock_find_host_by_fqdn.call_count == 1 assert mock_find_host_by_fqdn.call_count == 1
assert mock_sharepoint_client.call_count == 1 assert mock_sharepoint_client.call_count == 1
assert mock_kentik_client.call_count == 1
assert "ipam_warning" not in state assert "ipam_warning" not in state
......
...@@ -14,9 +14,7 @@ from test.workflows import assert_complete, assert_lso_interaction_success, extr ...@@ -14,9 +14,7 @@ from test.workflows import assert_complete, assert_lso_interaction_success, extr
@patch("gso.workflows.router.terminate_router.NetboxClient.delete_device") @patch("gso.workflows.router.terminate_router.NetboxClient.delete_device")
@patch("gso.workflows.router.terminate_router.infoblox.delete_host_by_ip") @patch("gso.workflows.router.terminate_router.infoblox.delete_host_by_ip")
@patch("gso.workflows.router.terminate_router.LibreNMSClient.remove_device") @patch("gso.workflows.router.terminate_router.LibreNMSClient.remove_device")
@patch("gso.workflows.router.terminate_router.KentikClient")
def test_terminate_pe_router_full_success( def test_terminate_pe_router_full_success(
mock_kentik_client,
mock_librenms_remove_device, mock_librenms_remove_device,
mock_delete_host_by_ip, mock_delete_host_by_ip,
mock_delete_device, mock_delete_device,
...@@ -56,7 +54,6 @@ def test_terminate_pe_router_full_success( ...@@ -56,7 +54,6 @@ def test_terminate_pe_router_full_success(
assert mock_delete_device.call_count == 1 assert mock_delete_device.call_count == 1
assert mock_delete_host_by_ip.call_count == 1 assert mock_delete_host_by_ip.call_count == 1
assert mock_librenms_remove_device.call_count == 1 assert mock_librenms_remove_device.call_count == 1
assert mock_kentik_client.call_count == 1
assert mock_execute_playbook.call_count == lso_interaction_count assert mock_execute_playbook.call_count == lso_interaction_count
...@@ -64,7 +61,6 @@ def test_terminate_pe_router_full_success( ...@@ -64,7 +61,6 @@ def test_terminate_pe_router_full_success(
@pytest.mark.parametrize("remove_configuration", [True, False]) @pytest.mark.parametrize("remove_configuration", [True, False])
@pytest.mark.parametrize("update_ibgp_mesh", [True, False]) @pytest.mark.parametrize("update_ibgp_mesh", [True, False])
@patch("gso.services.lso_client._send_request") @patch("gso.services.lso_client._send_request")
@patch("gso.workflows.router.terminate_router.KentikClient")
@patch("gso.workflows.router.terminate_router.NetboxClient.delete_device") @patch("gso.workflows.router.terminate_router.NetboxClient.delete_device")
@patch("gso.workflows.router.terminate_router.infoblox.delete_host_by_ip") @patch("gso.workflows.router.terminate_router.infoblox.delete_host_by_ip")
@patch("gso.workflows.router.terminate_router.LibreNMSClient.remove_device") @patch("gso.workflows.router.terminate_router.LibreNMSClient.remove_device")
...@@ -72,7 +68,6 @@ def test_terminate_p_router_full_success( ...@@ -72,7 +68,6 @@ def test_terminate_p_router_full_success(
mock_librenms_remove_device, mock_librenms_remove_device,
mock_delete_host_by_ip, mock_delete_host_by_ip,
mock_delete_device, mock_delete_device,
mock_kentik_client,
mock_execute_playbook, mock_execute_playbook,
remove_configuration, remove_configuration,
update_ibgp_mesh, update_ibgp_mesh,
...@@ -109,5 +104,4 @@ def test_terminate_p_router_full_success( ...@@ -109,5 +104,4 @@ def test_terminate_p_router_full_success(
assert mock_delete_device.call_count == 1 assert mock_delete_device.call_count == 1
assert mock_delete_host_by_ip.call_count == 1 assert mock_delete_host_by_ip.call_count == 1
assert mock_librenms_remove_device.call_count == 1 assert mock_librenms_remove_device.call_count == 1
assert mock_kentik_client.call_count == 1
assert mock_execute_playbook.call_count == lso_interaction_count assert mock_execute_playbook.call_count == lso_interaction_count
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment