Add some tests to tree.py