예제 #1
0
 def test_node_children_by_prefix(self):
     """
     A node's children can be introspected optionally with a prefix.
     """
     node = ZNode("/zoo", self.client)
     node_path_a = yield self.client.create("/zoo/lion")
     yield self.client.create("/zoo/tiger")
     children = yield node.get_children("lion")
     children.sort()
     self.assertEqual(children[0].path, node_path_a)
     self.assertEqual(len(children), 1)
예제 #2
0
 def test_node_children(self):
     """
     A node's children can be introspected.
     """
     node = ZNode("/zoo", self.client)
     node_path_a = yield self.client.create("/zoo/lion")
     node_path_b = yield self.client.create("/zoo/tiger")
     children = yield node.get_children()
     children.sort()
     self.assertEqual(children[0].path, node_path_a)
     self.assertEqual(children[1].path, node_path_b)