Skip to content

Commit 5913dbc

Browse files
committed
added test for empty conditional dependencies
1 parent 05ea128 commit 5913dbc

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/unit/synapseclient/extensions/unit_test_create_json_schema.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,22 @@ def test_convert_conditional_properties_to_all_of(self) -> None:
349349
assert expected_cancer in all_of
350350
assert expected_healthy in all_of
351351

352+
def test_convert_no_conditional_properties_to_all_of(self) -> None:
353+
"""Test JSONSchema._convert_conditional_properties_to_all_of method."""
354+
# GIVEN a JSONSchema instance
355+
schema = JSONSchema()
356+
357+
# AND an empty conditional dependencies
358+
conditional_dependencies = {}
359+
360+
# WHEN converting to allOf
361+
all_of = schema._convert_conditional_properties_to_all_of(
362+
conditional_dependencies
363+
)
364+
365+
# THEN the result also be empty
366+
assert len(all_of) == 0
367+
352368

353369
@pytest.mark.parametrize(
354370
"node_name, expected_type, expected_is_array, expected_min, expected_max, expected_pattern, expected_format",

0 commit comments

Comments
 (0)