Пример #1
0
def test_load_insert():
    tree = RBush(8, 4)
    tree.load(data_array[:17])
    tree.load(data_array[17:20])

    tree2 = RBush(8, 4)
    tree2.load(data_array[:17])
    tree2.insert(*data_array[17])
    tree2.insert(*data_array[18])
    tree2.insert(*data_array[19])

    assert tree.to_json() == tree2.to_json()
Пример #2
0
def test_clean_tree():
    tree = RBush(4)
    tree.load(data_array)

    for i in range(len(data_array)):
        tree.remove(*data_array[i])

    assert tree.height == 1
    assert tree.to_json() == RBush(4).to_json()
Пример #3
0
def test_clear_tree():
    tree = RBush(4)
    tree.load(data_array)
    tree.clear()

    assert tree.to_json() == RBush(4).to_json()