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 new file mode 100644 index 000000000..01cb17aea --- /dev/null +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py @@ -0,0 +1,13 @@ +import json + +import pytest + + +def test_island_mode_post(flask_client): + resp = flask_client.post('/api/island-mode', data=json.dumps({"mode": "ransomware"}), follow_redirects=True) + assert resp.status_code == 200 + + +def test_island_mode_post__invalid_mode(flask_client): + with pytest.raises(TypeError): + flask_client.post('/api/island-mode', data=json.dumps({"mode": "bogus mode"}), follow_redirects=True)