File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
tests/unit/experimental/components Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,9 @@ def test_schema_constraint_validation_property_not_in_node_type() -> None:
245245 assert "on node type 'Person'" in str (exc_info .value )
246246
247247
248- def test_schema_constraint_with_additional_properties_allows_unknown_property () -> None :
248+ def test_schema_constraint_with_additional_properties_with_allows_unknown_property () -> (
249+ None
250+ ):
249251 # if additional_properties is True, we can define constraints that are not in the node_type
250252 schema_dict : dict [str , Any ] = {
251253 "node_types" : [
@@ -260,11 +262,11 @@ def test_schema_constraint_with_additional_properties_allows_unknown_property()
260262 ],
261263 }
262264
263- # Should NOT raise - email is allowed because additional_properties=True
264- schema = GraphSchema .model_validate (schema_dict )
265+ # Should raise - email is not allowed because the property is not defined in the node
266+ with pytest .raises (SchemaValidationError ) as exc_info :
267+ GraphSchema .model_validate (schema_dict )
265268
266- assert len (schema .constraints ) == 1
267- assert schema .constraints [0 ].property_name == "email"
269+ assert "Constraint references undefined property 'email'" in str (exc_info .value )
268270
269271
270272def test_schema_with_valid_constraints () -> None :
You can’t perform that action at this time.
0 commit comments