class TestNode(unittest.TestCase): def setUp(self): self.node = Node() self.callback_call_count = 0 def testEq(self): self.assertEqual(self.node, Node()) def testNe(self): self.assertNotEqual(self.node, None) def testWalk(self): self.node.walk(self.callback) self.assertEqual(self.callback_call_count, 1) def callback(self, node): self.callback_call_count += 1
def setUp(self): self.node = Node() self.callback_call_count = 0