Exemple #1
0
 def test_parent_path_new(self, node_path, expected_parent_path):
     """
     Tests if node's parent path are properly computed.
     """
     node = Node(node_path, NodeKind.DIR)
     parent_path = node.get_parent_path()
     assert (parent_path.endswith('/')
             or node.is_root() and parent_path == '')
     assert parent_path == expected_parent_path
Exemple #2
0
 def _test_parent_path(self, node_path, expected_parent_path):
     """
     Tests if node's parent path are properly computed.
     """
     node = Node(node_path, NodeKind.DIR)
     parent_path = node.get_parent_path()
     self.assertTrue(parent_path.endswith('/') or \
         node.is_root() and parent_path == '')
     self.assertEqual(parent_path, expected_parent_path,
         "Node's path is %r and parent path is %r but should be %r"
         % (node.path, parent_path, expected_parent_path))
Exemple #3
0
 def _test_parent_path(self, node_path, expected_parent_path):
     """
     Tests if node's parent path are properly computed.
     """
     node = Node(node_path, NodeKind.DIR)
     parent_path = node.get_parent_path()
     self.assertTrue(parent_path.endswith('/') or \
         node.is_root() and parent_path == '')
     self.assertEqual(parent_path, expected_parent_path,
         "Node's path is %r and parent path is %r but should be %r"
         % (node.path, parent_path, expected_parent_path))