Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ammar257ammar committed Dec 12, 2024
1 parent 7c51fff commit 0edc735
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions app/tests/hanging_protocols_tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
),
Expand All @@ -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."
]
},
),
Expand All @@ -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."
]
},
),
Expand All @@ -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."
]
},
),
Expand All @@ -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."
]
},
),
Expand All @@ -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."
]
},
),
Expand All @@ -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."
]
},
),
Expand All @@ -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."
]
},
),
Expand All @@ -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."
]
},
),
Expand All @@ -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(
Expand Down

0 comments on commit 0edc735

Please sign in to comment.