Exemple #1
0
def test_UndecodableRecord_upon_update(byte, encoding, security):
    t = MerkleTree('a',
                   'b',
                   'c',
                   encoding=encoding,
                   security=security,
                   raw_bytes=False)
    with pytest.raises(UndecodableRecord):
        t.update(record=byte)
Exemple #2
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')