def test_contraint_array_additional_items_invalid(): flattener = JsonSchemaFlattener({}) schema = {"additionalItems": {"type": "string"}} with pytest.raises(ConstraintError) as excinfo: flattener._flatten_array_type(schema, (UNIQUE_KEY, )) assert UNIQUE_KEY in str(excinfo.value)
def test_contraint_array_additional_items_valid(): flattener = JsonSchemaFlattener({}) schema = {} result = flattener._flatten_array_type(schema, (UNIQUE_KEY, )) assert result == schema