Beispiel #1
0
def test_validation_OK():
    A, B, subject, obj, predicate = _generate_message_params()
    msg = Message(sender=A,
                  receiver=B,
                  subject=subject,
                  obj=obj,
                  predicate=predicate)
    assert msg.is_valid()
Beispiel #2
0
def test_validation_invalid_predicate():
    A, B, subject, obj, predicate = _generate_message_params()
    for x in _generate_invalid_uri_list():
        predicate = x
        msg = Message(sender=A,
                      receiver=B,
                      subject=subject,
                      obj=obj,
                      predicate=predicate)
        assert not msg.is_valid()
Beispiel #3
0
def test_validation_bogus_parameter():
    A, B, subject, obj, predicate = _generate_message_params()
    msg = Message(bogus=True, sender=A, receiver=B, subject=subject, obj=obj)
    assert not msg.is_valid()
Beispiel #4
0
def test_validation_invalid_no_reciever():
    A, B, subject, obj, predicate = _generate_message_params()
    msg = Message(sender=A, subject=subject, obj=obj, predicate=predicate)
    assert not msg.is_valid()