MCPcopy Index your code
hub / github.com/plotly/dash / test_validate_schema_mixed

Function test_validate_schema_mixed

tests/unit/library/test_grouping.py:287–311  ·  view source on GitHub ↗
(mixed_grouping_size)

Source from the content-addressed store, hash-verified

285
286
287def test_validate_schema_mixed(mixed_grouping_size):
288 grouping, size = mixed_grouping_size
289 schema = make_schema_with_nones(grouping)
290 validate_grouping(grouping, schema)
291
292 # check validation failures
293 with pytest.raises(SchemaTypeValidationError):
294 validate_grouping(None, schema)
295
296 # Check invalid list/tuple value
297 if isinstance(schema, (list, tuple)):
298 err = SchemaLengthValidationError
299 else:
300 err = SchemaTypeValidationError
301 with pytest.raises(err):
302 validate_grouping((None,), schema)
303
304 # Check invalid dict value
305 if isinstance(schema, dict):
306 err = SchemaKeysValidationError
307 else:
308 err = SchemaTypeValidationError
309
310 with pytest.raises(err):
311 validate_grouping({"A": 0, "bogus": 2}, schema)

Callers

nothing calls this directly

Calls 2

validate_groupingFunction · 0.90
make_schema_with_nonesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…