def test_get_path_string_on_nested_path(self): root = Tree('root') a = Tree('a') root.add_child(a) b = Tree('b') a.add_child(b) path = b.get_path() self.assertEqual(path, '/root/a/b')
def test_get_path_when_root_node_has_value_of_slash_doesnt_show_double_slash(self): root = Tree(root=True) path = root.get_path() self.assertEqual(path, '/')
def test_root_node_has_path_of_forward_slash_plus_value(self): root = Tree('root') path = root.get_path() self.assertEqual(path, '/root')
def test_get_path_string(self): root = Tree('root') a = Tree('a') root.add_child(a) path = a.get_path() self.assertEqual(path, '/root/a')