From 9990cdc6a8b740d57d76db840fb3d4129882cd11 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 1 Jul 2022 11:40:21 -0400 Subject: [PATCH] UT: Parametrize test_save_simulation() --- .../cc/repository/test_file_simulation_repository.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/monkey/tests/unit_tests/monkey_island/cc/repository/test_file_simulation_repository.py b/monkey/tests/unit_tests/monkey_island/cc/repository/test_file_simulation_repository.py index b5b0f63da..ca4bc6b8c 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/repository/test_file_simulation_repository.py +++ b/monkey/tests/unit_tests/monkey_island/cc/repository/test_file_simulation_repository.py @@ -11,15 +11,12 @@ def simulation_repository(): return FileSimulationRepository(SingleFileRepository()) -def test_save_simulation(simulation_repository): - simulation = Simulation(IslandModeEnum.RANSOMWARE) - - old_simulation = simulation_repository.get_simulation() +@pytest.mark.parametrize("mode", list(IslandModeEnum)) +def test_save_simulation(simulation_repository, mode): + simulation = Simulation(mode) simulation_repository.save_simulation(simulation) - new_simulation = simulation_repository.get_simulation() - assert old_simulation != simulation - assert new_simulation == simulation + assert simulation_repository.get_simulation() == simulation def test_get_default_simulation(simulation_repository):