コード例 #1
0
def test_validate_invalid_values_raise_validation_error(attr, value):
    """
    If an invalid value is given, an ValidationError must be raised.
    """
    metadata = MetaData(**VALID_METADATA)
    setattr(metadata, attr, value)

    with pytest.raises(exceptions.ValidationError):
        metadata.validate()
コード例 #2
0
def test_validate_all_parameters_ok():
    """
    If all parameters are valid than the validation should simply return.
    """
    metadata = MetaData(**VALID_METADATA)
    metadata.validate()