def test_Tree_exists_zero(data): from pymvptree import Tree, Point p = Point(b'', data) t = Tree() assert not t.exists(p)
def test_Tree_exists_one_equal(p1_data): from pymvptree import Tree, Point t = Tree() p = Point(b'', p1_data) t.add(p) assert t.exists(Point(b'', p1_data))
def test_Tree_exists_one_different(p1_data, p2_data): from pymvptree import Tree, Point assume(p1_data != p2_data) p = Point(b'p1', p1_data) t = Tree() t.add(p) assert not t.exists(Point(b'p2', p2_data))
def test_Tree_add_and_exists_until_full(leafcap, data): from pymvptree import Tree, Point t = Tree(leafcap=leafcap) added_data = set() for d in data: try: point = Point(d, d) t.add(point) except: break else: assert t.exists(Point(d, d)) added_data.add(point) assert added_data assert added_data == set(t.filter(b'0', 8))