def test_xfail_pattern_validation(validator, pattern, n_errors, _):
    errors = validate_json(pattern, validator)
    assert len(errors) == n_errors
Beispiel #2
0
def test_json_schema_training_invalid(data, n_errors, training_schema_validator):
    errors = validate_json([data], training_schema_validator)
    assert len(errors) == n_errors
Beispiel #3
0
def test_doc_to_json_valid_training(doc):
    json_doc = doc.to_json()
    validator = get_json_validator(TRAINING_SCHEMA)
    errors = validate_json([json_doc], validator)
    assert not errors
Beispiel #4
0
def test_json_schema_training_valid(data, training_schema_validator):
    errors = validate_json([data], training_schema_validator)
    assert not errors
def test_json_schema_training_invalid(data, n_errors,
                                      training_schema_validator):
    errors = validate_json([data], training_schema_validator)
    assert len(errors) == n_errors
def test_json_schema_training_valid(data, training_schema_validator):
    errors = validate_json([data], training_schema_validator)
    assert not errors
def test_pattern_validation(validator, pattern, n_errors):
    errors = validate_json(pattern, validator)
    assert len(errors) == n_errors
Beispiel #8
0
def test_doc_to_json_valid_training(doc):
    json_doc = doc.to_json()
    validator = get_json_validator(TRAINING_SCHEMA)
    errors = validate_json([json_doc], validator)
    assert not errors