Esempio n. 1
0
def test_tree_empty_store():
    store = {}
    t = Tree(store)
    t.multi_add([b"test"])
    assert t.is_in(b"test")

    t2 = Tree(store, root_hash=t.root())
    assert t2.is_in(b"test")
Esempio n. 2
0
def test_evidence():
    from hippiehug import Tree
    t = Tree()
    t.add("Hello")
    t.add("World")

    root, E = t.evidence("World")
    assert root == t.root()
    store = dict((e.identity(), e) for e in E)
    t2 = Tree(store, root)
    assert "World" in t2
Esempio n. 3
0
def test_evidence():
    from hippiehug import Tree
    t = Tree()
    t.add(b"Hello")
    t.add(b"World")

    root, E = t.evidence(b"World")
    assert root == t.root()
    store = dict((e.identity(), e) for e in E)
    t2 = Tree(store, root)
    assert b"World" in t2