forked from p15670423/monkey
tests: Monkeypath `ConfigService.update_config_on_mode_set` for POST test in `test_island_mode.py`
This commit is contained in:
parent
743619b81b
commit
28461bd607
|
@ -13,7 +13,11 @@ def uses_database():
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("mode", ["ransomware", "advanced"])
|
@pytest.mark.parametrize("mode", ["ransomware", "advanced"])
|
||||||
def test_island_mode_post(flask_client, mode):
|
def test_island_mode_post(flask_client, mode, monkeypatch):
|
||||||
|
monkeypatch.setattr(
|
||||||
|
"monkey_island.cc.services.mode.set_island_mode_service.ConfigService.update_config_on_mode_set", # noqa: E501
|
||||||
|
lambda _: None,
|
||||||
|
)
|
||||||
resp = flask_client.post(
|
resp = flask_client.post(
|
||||||
"/api/island-mode", data=json.dumps({"mode": mode}), follow_redirects=True
|
"/api/island-mode", data=json.dumps({"mode": mode}), follow_redirects=True
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue