diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py b/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py index a49512bf3..2e603864d 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py @@ -4,9 +4,9 @@ import pytest from tests.utils import raise_ from monkey_island.cc.models.island_mode_model import IslandMode -from monkey_island.cc.services.mode.mode_enum import IslandModeEnum from monkey_island.cc.resources import island_mode as island_mode_resource from monkey_island.cc.resources.island_mode import IslandMode as IslandModeResource +from monkey_island.cc.services.mode.mode_enum import IslandModeEnum @pytest.fixture(scope="function") @@ -14,7 +14,10 @@ def uses_database(): IslandMode.objects().delete() -@pytest.mark.parametrize("mode", [IslandModeEnum.RANSOMWARE.value, IslandModeEnum.ADVANCED.value, IslandModeEnum.UNSET.value]) +@pytest.mark.parametrize( + "mode", + [IslandModeEnum.RANSOMWARE.value, IslandModeEnum.ADVANCED.value, IslandModeEnum.UNSET.value], +) def test_island_mode_post(flask_client, mode, monkeypatch): monkeypatch.setattr( "monkey_island.cc.resources.island_mode.update_config_on_mode_set", @@ -43,7 +46,9 @@ def test_island_mode_post__internal_server_error(monkeypatch, flask_client): monkeypatch.setattr(island_mode_resource, "set_mode", lambda x: raise_(Exception())) resp = flask_client.post( - IslandModeResource.urls[0], data=json.dumps({"mode":IslandModeEnum.RANSOMWARE.value}), follow_redirects=True + IslandModeResource.urls[0], + data=json.dumps({"mode": IslandModeEnum.RANSOMWARE.value}), + follow_redirects=True, ) assert resp.status_code == 500