Example #1
0
def test_add_like_a_monkey():
	
	root = Leaf("Hello")
	store = {root.identity() : root}

	from os import urandom
	for _ in range(100):
		item = urandom(32)
		root = root.add(store, item)
		root.check(store)
		assert root.is_in(store, item)
def test_add_like_a_monkey():

    root = Leaf(b"Hello", b"Hello")
    store = {root.identity(): root}

    from os import urandom
    for _ in range(100):
        item = urandom(32)
        root = root.add(store, item, item)
        root.check(store)
        assert root.is_in(store, item, item)
def test_leaf_isin_map():
    l = Leaf(item=b"Hello", key=b"World")
    store = {l.identity(): l}
    b = l.add(store, b"World", b"World")
    assert l.is_in(store, item=b"Hello", key=b"World")
def test_leaf_isin():
    l = Leaf(b"Hello", b"Hello")
    store = {l.identity(): l}
    b = l.add(store, b"Woitemrld", b"Woitemrld")
    assert l.is_in(store, b"Hello", b"Hello")
Example #5
0
def test_leaf_isin():
	l = Leaf("Hello")
	store = {l.identity() : l}
	b = l.add(store, "World")
	assert l.is_in(store, "Hello")