File: testintervaltree.py

package info (click to toggle)
python-sqt 0.8.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 824 kB
  • sloc: python: 5,964; sh: 38; makefile: 10
file content (18 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""
Tests for the sqt.intervaltree module
"""
import sys
from sqt.intervaltree import IntervalTree

__author__ = "Johannes Köster"

def test_intervaltree():
	tree = IntervalTree()
	tree.insert(1,10)
	tree.insert(5,20)
	tree.insert(8,20)
	print(tree)
	print(list(tree.find(10,11)))
	assert len(list(tree.find(10,11))) == 3
	assert len(list(tree.find(1,4))) == 1
	assert len(list(tree.find(30,40))) == 0