Ejemplo n.º 1
0
    def test_find_ancestral_path(self):

        ITEMS = [BHO(i) for i in range(5)]
        B201 = BHO(201, 2, 110)
        B202, B203, B204 = [BHO(i) for i in range(202, 205)]

        cf = ChainFinder()
        items = ITEMS + [B202, B203, B204]
        load_items(cf, items)

        load_items(cf, [B201])

        old_chain_endpoint, new_chain_endpoint = 4, 204

        old_subpath, new_subpath = cf.find_ancestral_path(old_chain_endpoint, new_chain_endpoint)
        assert old_subpath == [4, 3, 2]
        assert new_subpath == [204, 203, 202, 201, 2]
Ejemplo n.º 2
0
def test_large():
    ITEMS = [BHO(i) for i in range(10000)]
    cf = ChainFinder()
    load_items(cf, ITEMS)
    old_subpath, new_subpath = cf.find_ancestral_path(5000, 9000)
Ejemplo n.º 3
0
 def test_large(self):
     ITEMS = [BHO(i) for i in range(10000)]
     cf = ChainFinder()
     load_items(cf, ITEMS)
     old_subpath, new_subpath = cf.find_ancestral_path(5000, 9000)