Ejemplo n.º 1
0
    def _GetDirectory(self):
        """Retrieves the directory.

    Returns:
      Directory: a directory or None.
    """
        return file_entry.Directory(self._file_system, self.path_spec)
Ejemplo n.º 2
0
    def testEntriesGenerator(self):
        """Tests the _EntriesGenerator function."""
        test_directory = file_entry.Directory(self._file_system,
                                              self._path_spec)

        generator = test_directory._EntriesGenerator()
        self.assertIsNotNone(generator)
Ejemplo n.º 3
0
    def testEntries(self):
        """Test the entries property."""
        file_system = fake_file_system.FakeFileSystem(self._resolver_context)
        file_system.Open(self._fake_path_spec)

        test_directory = file_entry.Directory(file_system,
                                              self._fake_path_spec)
        self.assertEqual(list(test_directory.entries), [])

        file_system.Close()
Ejemplo n.º 4
0
    def testEntries(self):
        """Tests the entries property."""
        test_directory = file_entry.Directory(self._file_system,
                                              self._path_spec)

        self.assertEqual(list(test_directory.entries), [])