def test_list_object_names(self): """Test the `list_object_names` method.""" node = Node() node.put_object_from_tree(self.tempdir, '') self.assertEqual(sorted(node.list_object_names()), ['c.txt', 'subdir']) self.assertEqual(sorted(node.list_object_names('subdir')), ['a.txt', 'b.txt', 'nested'])
def test_erase_unstored(self): """ Test that _repository.erase removes the content of an unstored node. """ node = Node() node.put_object_from_tree(self.tempdir, '') self.assertEqual(sorted(node.list_object_names()), ['c.txt', 'subdir']) self.assertEqual(sorted(node.list_object_names('subdir')), ['a.txt', 'b.txt', 'nested']) node._repository.erase() # pylint: disable=protected-access self.assertEqual(node.list_object_names(), [])