def test_invalid_count_param_values_spec(): values_schema = types.lookup_schema('values') with pytest.raises(SpecException): spec = {'type': 'values', 'data': [1, 2, 3], 'config': {'count': {}}} validate_schema_for_spec('values', spec, values_schema)
def test_load_and_validate_invalid_schema(): range_schema = types.lookup_schema('range') with pytest.raises(SpecException): validate_schema_for_spec('range', {'type': 'range'}, range_schema)
def _test_lookup_from_registry(type_name): schema = types.lookup_schema(type_name) assert schema is not None assert isinstance(schema, dict) is True
def test_load_and_validate_schema(): range_schema = types.lookup_schema('range') validate_schema_for_spec('range', { 'type': 'range', 'data': [0, 10] }, range_schema)
def test_lookup_schema(key, should_exist): schema = registries.lookup_schema(key) if should_exist: assert schema is not None else: assert schema is None