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