So I'm writing unit test cases in python for the first time. Here's what I've got so far
import unittest
from . BinarySearchTree import BinarySearchTree
def Test_bst(unittest.TestCase):
def setUp(self):
bst = BinrySearchTree()
bst.put(21, "a")
bst.put(18, "b")
bst.put(10, "c")
bst.put(40, "d")
bst.put(8, "e")
bst.put(11, "f")
def test_get(self):
self.assertEqual("f", bst.get(11))
if __name__ == '__main__':
unittest.main()
main()
Obviously I'm testing a binary search tree in the same directory. The issue I'm having is when I run this file I get an error that looks like
File "Test_bst.py", line 4
def Test_bst(unittest.TestCase):
^
SyntaxError: invalid syntax
I'm just pretty confused because I've been reading all of the documentation and I'm pretty sure it's all correct and I can't find any similar issues. Thanks y'all
class, not adef?