def testIntialize(self): """Test the initialize functionality.""" file_entry = os_file_entry.OSFileEntry(self._resolver_context, self._file_system, self._os_path_spec) self.assertNotEqual(file_entry, None)
def testIntialize(self): """Test the __init__ function.""" file_entry = os_file_entry.OSFileEntry(self._resolver_context, self._file_system, self._os_path_spec) self.assertIsNotNone(file_entry)
def testAccessTime(self): """Test the access_time property.""" file_entry = os_file_entry.OSFileEntry(self._resolver_context, self._file_system, self._os_path_spec) self.assertIsNotNone(file_entry) self.assertIsNotNone(file_entry.access_time)
def testName(self): """Test the name property.""" file_entry = os_file_entry.OSFileEntry(self._resolver_context, self._file_system, self._os_path_spec) self.assertIsNotNone(file_entry) self.assertEqual(file_entry.name, 'testdir_os')
def testModificationTime(self): """Test the modification_time property.""" file_entry = os_file_entry.OSFileEntry(self._resolver_context, self._file_system, self._os_path_spec) self.assertIsNotNone(file_entry) self.assertIsNotNone(file_entry.modification_time)
def testChangeTime(self): """Test the change_time property.""" file_entry = os_file_entry.OSFileEntry(self._resolver_context, self._file_system, self._os_path_spec) self.assertIsNotNone(file_entry) # Not all operating systems provide a change time. _ = file_entry.change_time
def testSize(self): """Test the size property.""" file_entry = os_file_entry.OSFileEntry(self._resolver_context, self._file_system, self._os_path_spec) self.assertIsNotNone(file_entry) # The size of a directory differs per operating system. _ = file_entry.size
def GetFileEntryByPathSpec(self, path_spec): """Retrieves a file entry for a path specification. Args: path_spec (PathSpec): a path specification. Returns: OSFileEntry: a file entry or None if not available. """ if not self.FileEntryExistsByPathSpec(path_spec): return None return os_file_entry.OSFileEntry(self._resolver_context, self, path_spec)
def GetFileEntryByPathSpec(self, path_spec): """Retrieves a file entry for a path specification. Args: path_spec: a path specification (instance of path.PathSpec). Returns: A file entry (instance of vfs.FileEntry) or None. """ if not self.FileEntryExistsByPathSpec(path_spec): return return os_file_entry.OSFileEntry(self._resolver_context, self, path_spec)