Exemple #1
0
def test_linkorelse_deserialize():
    loe = LinkOrElse()
    lbu = loe.deserialize({
        'type': LinkByUID.typ,
        'scope': 'foo',
        'id': uuid.uuid4()
    })
    assert isinstance(lbu, LinkByUID)
Exemple #2
0
def test_linkorelse_deserialize_requires_scope_and_id():
    loe = LinkOrElse()
    with pytest.raises(ValueError):
        loe.deserialize({'type': LinkByUID.typ})
Exemple #3
0
def test_linkorelse_deserialize_requires_serializable():
    loe = LinkOrElse()
    with pytest.raises(Exception):
        loe.deserialize({})