From 0edc735ab993992fc17f1ea4f185c3a83865f072 Mon Sep 17 00:00:00 2001 From: Ammar Ammar <43293485+ammar257ammar@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:33:42 +0000 Subject: [PATCH] Update tests --- .../hanging_protocols_tests/test_forms.py | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/tests/hanging_protocols_tests/test_forms.py b/app/tests/hanging_protocols_tests/test_forms.py index 0ba2189f4..892e8ce48 100644 --- a/app/tests/hanging_protocols_tests/test_forms.py +++ b/app/tests/hanging_protocols_tests/test_forms.py @@ -320,12 +320,19 @@ def test_hanging_protocol_clientside(): @pytest.mark.parametrize( "hanging_protocol_json, form_is_valid, form_errors", ( + ("[]", False, {"json": ["This field is required."]}), + ("{}", False, {"json": ["This field is required."]}), + ( + '[{"viewport_name": "main"}]', + True, + {}, + ), ( 12345, False, { "json": [ - "JSON does not fulfill schema: instance is not of type 'array'" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -335,7 +342,7 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance None of are valid under the given schema" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -344,7 +351,7 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance None of are valid under the given schema" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -353,7 +360,7 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance None of are valid under the given schema" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -362,7 +369,7 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance has non-unique elements" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -371,7 +378,7 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance is not of type 'array'" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -380,7 +387,7 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance is not of type 'array'" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -389,18 +396,16 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance is not of type 'array'" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), - ("[]", False, {"json": ["This field is required."]}), - ("{}", False, {"json": ["This field is required."]}), ( "[{}]", False, { "json": [ - "JSON does not fulfill schema: instance 'viewport_name' is a required property" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -409,7 +414,7 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance 'viewport_name' is a required property" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), @@ -418,15 +423,10 @@ def test_hanging_protocol_clientside(): False, { "json": [ - "JSON does not fulfill schema: instance 'viewport_name' is a required property" + "Hanging protocol definition is invalid. Have a look at the example in the helptext." ] }, ), - ( - '[{"viewport_name": "main"}]', - True, - {}, - ), ), ) def test_hanging_protocol_form_json_validation(