def test_schemas(md, expected): if expected is SAME: expected = dict(md) if inspect.isclass(expected): with pytest.raises(expected): validate_metadata(md) else: assert validate_metadata(md) == expected
def test_no_variety(): with pytest.raises(ValueError): validate_metadata({'test': 'a'})
def test_empty_md(): validate_metadata({})