Commit e1b656a4 authored by Andreas Fischer's avatar Andreas Fischer
Browse files

Check for insert and search methods

parent 2335b3de
......@@ -9,6 +9,12 @@ class TestBinTree(unittest.TestCase):
tree = BinTree()
self.assertIsNone(tree.root)
def test_has_insert_and_search(self):
tree = BinTree()
tree.insert(1)
tree.search(1)
class TestBinTreeNode(unittest.TestCase):
def test_creation(self):
node = BinTreeNode(5)
......@@ -19,5 +25,10 @@ class TestBinTreeNode(unittest.TestCase):
self.assertIn("left", node.__dict__)
self.assertIn("right", node.__dict__)
def test_has_insert_and_search(self):
node = BinTreeNode(0)
node.insert(1)
node.search(1)
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment