Exemplo n.º 1
0
 def setUp(self):
     self.stdout = StringIO()
     self.stderr = StringIO()
     trash_directories = make_trash_directories()
     self.logger = Mock(spec=[])
     trashed_files = TrashedFiles(self.logger, trash_directories,
                                  TrashDirectory(), contents_of)
     self.fs = Mock(spec=restore.FileSystem)
     self.cmd = RestoreCmd(stdout=self.stdout,
                           stderr=self.stderr,
                           exit=self.capture_exit_status,
                           input=lambda x: self.user_reply,
                           version=None,
                           trashed_files=trashed_files,
                           mount_points=os_mount_points,
                           fs=self.fs)
Exemplo n.º 2
0
 def setUp(self):
     trash_directories = make_trash_directories()
     self.logger = Mock(spec=[])
     trashed_files = TrashedFiles(self.logger,
                                  trash_directories,
                                  None,
                                  contents_of)
     self.cmd = RestoreCmd(None, None,
                           exit=None,
                           input=None,
                           curdir=lambda: "dir",
                           trashed_files=trashed_files,
                           mount_points=os_mount_points,
                           fs=restore.FileSystem())
     self.cmd.handle_trashed_files = self.capture_trashed_files
     self.trashed_files = Mock(spec=['all_trashed_files'])
     self.cmd.trashed_files = self.trashed_files
Exemplo n.º 3
0
 def setUp(self):
     self.trash_directories = Mock(spec=['trash_directories_or_user'])
     self.trash_directory = Mock(spec=['all_info_files'])
     self.trashed_files = TrashedFiles(self.trash_directories,
                                       self.trash_directory,
                                       contents_of)