Skip to content

Commit 9240c94

Browse files
committed
fix failing test
1 parent f4475a0 commit 9240c94

14 files changed

+519
-1684
lines changed

simulation-system/libs/csle-common/tests/test_container_controller.py

+18-20
Original file line numberDiff line numberDiff line change
@@ -772,11 +772,9 @@ def test_start_docker_stats_thread(self, mocker: pytest_mock.MockFixture,
772772
physical_server_ip='123.456.78.99',
773773
logger=logging.Logger("test"))
774774

775-
def test_stop_docker_stats_thread(self, mocker: pytest_mock.MockFixture,
776-
example_emulation_execution: EmulationExecution,
777-
true_stop_fixture, false_running_stats_manager,
778-
true_running_stats_manager,
779-
false_stop_fixture, stop_fixture):
775+
def test_stop_docker_stats_thread(
776+
self, mocker: pytest_mock.MockFixture, example_emulation_execution: EmulationExecution, true_stop_fixture,
777+
false_running_stats_manager, true_running_stats_manager, false_stop_fixture, stop_fixture) -> None:
780778
"""
781779
Testing the stop_docker_stats_thread
782780
@@ -814,9 +812,9 @@ def test_stop_docker_stats_thread(self, mocker: pytest_mock.MockFixture,
814812
logging.getLogger("test"))
815813
assert stopper is None
816814

817-
def test_get_docker_stats_manager_status(self, mocker: pytest_mock.MockFixture, host_ip,
818-
example_docker_stats_manager_config: DockerStatsManagerConfig,
819-
dsm_status, stub):
815+
def test_get_docker_stats_manager_status(
816+
self, mocker: pytest_mock.MockFixture, host_ip,
817+
example_docker_stats_manager_config: DockerStatsManagerConfig, dsm_status, stub) -> None:
820818
"""
821819
Testing the get_docker_stats_manager_status method in the ContainerController
822820
@@ -837,8 +835,8 @@ def test_get_docker_stats_manager_status(self, mocker: pytest_mock.MockFixture,
837835
assert dsm_dto.emulations == ["JDoeEmulation"]
838836
assert dsm_dto.emulation_executions == [10]
839837

840-
def test_get_docker_stats_manager_status_by_ip_and_port(self, mocker: pytest_mock.MockFixture,
841-
host_ip, dsm_status, stub):
838+
def test_get_docker_stats_manager_status_by_ip_and_port(
839+
self, mocker: pytest_mock.MockFixture, host_ip, dsm_status, stub) -> None:
842840
"""
843841
Testing the get_docker_stats_manager_status_by_ip_and_port method in the ContainerController
844842
@@ -891,8 +889,8 @@ def test_create_network(self, mocker: pytest_mock.MockFixture, client_1, ipam_po
891889
mocker.patch('docker.from_env', side_effect=client_1)
892890
mocker.patch('docker.types.IPAMPool', side_effect=ipam_pool)
893891
mocker.patch('docker.types.IPAMConfig', side_effect=ipam_config)
894-
creator = ContainerController.create_network(name="JDoeCreator",
895-
subnetmask="null", logger=logging.Logger("test"))
892+
creator = ContainerController.create_network(name="JDoeCreator", subnetmask="null",
893+
logger=logging.Logger("test"))
896894
assert creator is None
897895

898896
def test_remove_network(self, mocker: pytest_mock.MockFixture, client_1) -> None:
@@ -950,7 +948,7 @@ def test_rm_network(self, mocker: pytest_mock.MockFixture, client_1) -> None:
950948
remover = ContainerController.rm_network("JDoe", logging.getLogger())
951949
assert remover is False
952950

953-
def test_run_command(self, mocker: pytest_mock.MockFixture, client_1, client_2):
951+
def test_run_command(self, mocker: pytest_mock.MockFixture, client_1, client_2) -> None:
954952
"""
955953
Testing the run_command method in the ContainerController
956954
@@ -964,8 +962,9 @@ def test_run_command(self, mocker: pytest_mock.MockFixture, client_1, client_2):
964962
runner = ContainerController.run_command(cmd=constants.MANAGEMENT.LIST_STOPPED)
965963
assert runner is None
966964

967-
def test_get_docker_stats_managers_ips(self, mocker: pytest_mock.MockFixture, socket_fix,
968-
example_emulation_env_config: EmulationEnvConfig):
965+
def test_get_docker_stats_managers_ips(
966+
self, mocker: pytest_mock.MockFixture, socket_fix, example_emulation_env_config: EmulationEnvConfig) \
967+
-> None:
969968
"""
970969
Testing the get_docker_stats_managers_ips
971970
@@ -978,7 +977,7 @@ def test_get_docker_stats_managers_ips(self, mocker: pytest_mock.MockFixture, so
978977
ip = ContainerController.get_docker_stats_managers_ips(example_emulation_env_config)
979978
assert ip == ["123.456.78.99"]
980979

981-
def test_get_docker_stats_managers_ports(self, example_emulation_env_config: EmulationEnvConfig):
980+
def test_get_docker_stats_managers_ports(self, example_emulation_env_config: EmulationEnvConfig) -> None:
982981
"""
983982
Testing the get_docker_stats_managers_ports in the ContainerController
984983
@@ -989,10 +988,9 @@ def test_get_docker_stats_managers_ports(self, example_emulation_env_config: Emu
989988
test_list = ContainerController.get_docker_stats_managers_ports(example_emulation_env_config)
990989
assert test_list[0] == 50046
991990

992-
def test_get_docker_stats_managers_info(self, mocker: pytest_mock.MockFixture, socket_fix,
993-
example_emulation_env_config: EmulationEnvConfig,
994-
host_ip, dsm_status, stub,
995-
example_docker_stats_managers_info: DockerStatsManagersInfo):
991+
def test_get_docker_stats_managers_info(
992+
self, mocker: pytest_mock.MockFixture, socket_fix, example_emulation_env_config: EmulationEnvConfig,
993+
host_ip, dsm_status, stub, example_docker_stats_managers_info: DockerStatsManagersInfo) -> None:
996994
"""
997995
Testing the get_docker_stats_managers_info
998996

0 commit comments

Comments
 (0)