bidsschematools.tests.test_utils

Module Attributes

Classes

class bidsschematools.tests.test_utils.TestJsonschemaValidator

Bases: object

test_check_format_email_scenarios(check_format: bool, instance: dict, expect_raises: bool) None

Parametrized test for check_format usage on valid/invalid email addresses under Draft202012Validator.

test_default_cls(schema: dict[str, Any], expected_validator_cls: type) None

If the schema has no ‘$schema’ property, and we provide a ‘default_cls’, the returned validator should be an instance of that class.

If the schema does have ‘$schema’, then the default_cls is ignored, and the validator class is inferred from the schema’s ‘$schema’ field.

test_invalid_schema_raises_schema_error() None

Provide an invalid schema, ensuring that ‘SchemaError’ is raised.