Skip to content

Commit

Permalink
Fix vstart command test (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcaiazzi committed Dec 19, 2023
1 parent 9d0aa01 commit 3ded2b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/cli/vstart_command_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def test_run_with_one_interface(mock_docker_manager, mock_manager_get_instance,
mock_manager_get_instance.return_value = mock_docker_manager
mock_setting_get_instance.return_value = mock_setting
mock_get_or_new_machine.return_value = Machine(test_lab, 'pc1')
default_device_args['eths'] = [('0', 'A')]
default_device_args['eths'] = [('0', 'A', None)]
command = VstartCommand()
with mock.patch.object(Lab, "add_option") as mock_add_option:
command.run('.', ['-n', 'pc1', '--eth', '0:A'])
Expand All @@ -205,7 +205,7 @@ def test_run_with_one_interface(mock_docker_manager, mock_manager_get_instance,
mock_add_option.assert_any_call('shared_mount', False)
mock_add_option.assert_any_call('privileged_machines', None)
mock_get_or_new_machine.assert_called_once_with('pc1', **default_device_args)
mock_connect_machine_to_link.assert_called_once_with('pc1', 'A', machine_iface_number=0)
mock_connect_machine_to_link.assert_called_once_with('pc1', 'A', machine_iface_number=0, mac_address=None)
mock_docker_manager.deploy_lab.assert_called_once()


Expand All @@ -220,7 +220,7 @@ def test_run_with_two_interfaces(mock_docker_manager, mock_manager_get_instance,
mock_manager_get_instance.return_value = mock_docker_manager
mock_setting_get_instance.return_value = mock_setting
mock_get_or_new_machine.return_value = Machine(test_lab, 'pc1')
default_device_args['eths'] = [('0', 'A'), ('1', 'B')]
default_device_args['eths'] = [('0', 'A', None), ('1', 'B', None)]
command = VstartCommand()
with mock.patch.object(Lab, "add_option") as mock_add_option:
command.run('.', ['-n', 'pc1', '--eth', '0:A', '1:B'])
Expand All @@ -231,8 +231,8 @@ def test_run_with_two_interfaces(mock_docker_manager, mock_manager_get_instance,
mock_add_option.assert_any_call('shared_mount', False)
mock_add_option.assert_any_call('privileged_machines', None)
mock_get_or_new_machine.assert_called_once_with('pc1', **default_device_args)
mock_connect_machine_to_link.assert_any_call('pc1', 'A', machine_iface_number=0)
mock_connect_machine_to_link.assert_any_call('pc1', 'B', machine_iface_number=1)
mock_connect_machine_to_link.assert_any_call('pc1', 'A', machine_iface_number=0, mac_address=None)
mock_connect_machine_to_link.assert_any_call('pc1', 'B', machine_iface_number=1, mac_address=None)
mock_docker_manager.deploy_lab.assert_called_once()


Expand Down

0 comments on commit 3ded2b7

Please sign in to comment.