From 4cab3ae15194b75d79c593eab41bc5c458e15640 Mon Sep 17 00:00:00 2001 From: Annielated Date: Sat, 29 May 2021 13:44:25 +0200 Subject: [PATCH] aggiunto test put for_success --- nest_backend/test/test_4_alert.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/nest_backend/test/test_4_alert.py b/nest_backend/test/test_4_alert.py index f0cd0fb..6343d91 100644 --- a/nest_backend/test/test_4_alert.py +++ b/nest_backend/test/test_4_alert.py @@ -170,6 +170,7 @@ class TestAlertGet: assert r.json["result"] == "success" +class TestAlertPatch: def test_patch_alert_no_json(self, flask_client: Client, user_headers): r = flask_client.patch(f'/api/v1/alert/1', headers=user_headers) assert r.status_code == 400 @@ -194,6 +195,31 @@ class TestAlertGet: class TestAlertPut: + def test_for_success(self, flask_client: Client, user_headers): + r = flask_client.put(f'/api/v1/alert/2', headers=user_headers, json={ + "conditions": [ + { + "content": "string", + "id": 0, + "type": 0 + } + ], + "evaluation_mode": 0, + "id": 0, + "limit": 0, + "name": "string", + "notifications": [ + { + "id": 0, + "ora": "2021-05-29T11:32:38.664Z", + "repository_id": 0 + } + ], + "repository_id": 0, + "window_size": 0 + }) + assert r.status_code == 200 + def test_put_alert_no_json(self, flask_client: Client, user_headers): r = flask_client.put(f'/api/v1/alert/2', headers=user_headers) assert r.status_code == 400