Island: Add a couple of island mode resource unit tests

This commit is contained in:
VakarisZ 2021-07-12 16:00:23 +03:00
parent 2778b69dfb
commit 3bde6f013a
1 changed files with 13 additions and 0 deletions

View File

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