Esempio n. 1
0
def test_LeafConstructionError_upon_update():
    """Tests that a `LeafConstructionError` is raised if both `record` and `digest`
    are provided as arguments to the `MerkleTree.update()` method
    """

    t = MerkleTree()

    with pytest.raises(LeafConstructionError):
        t.update(
            record='some record',
            digest=
            '540ef8fc9eefa3ec0fbe55bc5d10dbea03d5bac5591b3d7db3af79ec24b3f74c')
Esempio n. 2
0
def test_UndecodableRecordError_upon_update(_byte, _encoding, _security):

    t = MerkleTree('a', 'b', 'c', encoding=_encoding, security=_security)

    with pytest.raises(UndecodableRecordError):
        t.update(record=_byte)