Skip to content
Snippets Groups Projects
Commit 7ff12c61 authored by Andreas Fischer's avatar Andreas Fischer
Browse files

Check insert into empty tree

parent e1b656a4
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,12 @@ class TestBinTree(unittest.TestCase):
tree.insert(1)
tree.search(1)
def test_insert_into_empty_tree(self):
tree = BinTree()
tree.insert(1)
self.assertIsNotNone(tree.root)
self.assertIsInstance(tree.root, BinTreeNode)
self.assertEqual(tree.root.value, 1)
class TestBinTreeNode(unittest.TestCase):
def test_creation(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment