def test_z1_final_test(self): sample = Node("root", left=Node("left-1", left=Node("left-2", left=Node("left-3"), right=Node("right-3"))), right=Node("right-1")) print(sample.serialize()) self.assertEqual( Node.deserialize(sample.serialize()).left.left.right.val, "right-3")
def test_04_deserialize01(self): self.assertEqual(Node.deserialize("root # #"), Node("root"))
def test_z0_final_test(self): sample = Node("root", Node("left-1", Node("left-2")), Node("right-1")) self.assertEqual( Node.deserialize(sample.serialize()).left.left.val, "left-2")
def test_05_deserialize02(self): sample = "root left-1 left-2 # # # right-1 # #" self.assertEqual(Node.deserialize(sample).left.left.val, "left-2")