tests: Monkeypath `ConfigService.update_config_on_mode_set` for POST test in `test_island_mode.py`

This commit is contained in:
Shreya 2021-07-19 17:20:31 +05:30
parent 743619b81b
commit 28461bd607
1 changed files with 5 additions and 1 deletions

View File

@ -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
) )