Skip to content

Commit 498f1f1

Browse files
committed
netapp: integration test - extra expectations
1 parent f33964a commit 498f1f1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

python/understack-workflows/tests/test_netapp_configure_net_integration.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,14 @@ def test_complete_script_execution_with_netapp_interface_creation(
595595
# The complex sample has 4 interfaces, so create_lif should be called 4 times
596596
assert mock_netapp_manager_instance.create_lif.call_count == 4
597597

598+
# Verify route creation was called with correct parameters
599+
mock_netapp_manager_instance.create_routes_for_project.assert_called_once()
600+
route_call_args = (
601+
mock_netapp_manager_instance.create_routes_for_project.call_args
602+
)
603+
assert route_call_args[0][0] == "12345678123456789abc123456789012" # project_id
604+
assert len(route_call_args[0][1]) == 4 # 4 interface configurations
605+
598606
# Verify output was printed
599607
mock_print.assert_called_once()
600608

@@ -659,6 +667,14 @@ def test_script_execution_with_custom_netapp_config_path(
659667
# Verify NetApp LIF creation was called (single sample has 2 interfaces)
660668
assert mock_netapp_manager_instance.create_lif.call_count == 2
661669

670+
# Verify route creation was called with correct parameters
671+
mock_netapp_manager_instance.create_routes_for_project.assert_called_once()
672+
route_call_args = (
673+
mock_netapp_manager_instance.create_routes_for_project.call_args
674+
)
675+
assert route_call_args[0][0] == "12345678123456789abc123456789012" # project_id
676+
assert len(route_call_args[0][1]) == 2 # 2 interface configurations
677+
662678
# Verify output was printed
663679
mock_print.assert_called_once()
664680

@@ -791,6 +807,9 @@ def test_script_execution_with_empty_vm_results_skips_netapp_creation(
791807
# Verify create_lif was NOT called (no interfaces to create)
792808
mock_netapp_manager_instance.create_lif.assert_not_called()
793809

810+
# Verify route creation was NOT called (no interfaces to create routes for)
811+
mock_netapp_manager_instance.create_routes_for_project.assert_not_called()
812+
794813
# Verify output was still printed (empty results)
795814
mock_print.assert_called_once()
796815

@@ -874,6 +893,14 @@ def test_end_to_end_netapp_interface_creation_with_realistic_data(
874893
call.args[1], "name"
875894
) # Should have interface config with name attribute
876895

896+
# Verify route creation was called with correct parameters
897+
mock_netapp_manager_instance.create_routes_for_project.assert_called_once()
898+
route_call_args = (
899+
mock_netapp_manager_instance.create_routes_for_project.call_args
900+
)
901+
assert route_call_args[0][0] == project_id_normalized # project_id
902+
assert len(route_call_args[0][1]) == 4 # 4 interface configurations
903+
877904
# Verify output was printed
878905
mock_print.assert_called_once()
879906
printed_output = mock_print.call_args[0][0]

0 commit comments

Comments
 (0)