def setUp(self): self.trashdirectory_base_dir = os.path.realpath( "./sandbox/testTrashDirectory") require_empty_dir(self.trashdirectory_base_dir) self.instance = TrashDirectoryForPut(self.trashdirectory_base_dir, "/", None, RealFs())
def setUp(self): self.path = MyPath.make_temp_dir() self.fs = RealFs() self.logger = Mock() self.suffix = Mock() self.suffix.suffix_for_index.side_effect = lambda i: '.suffix-%s' % i self.info_dir = InfoDir(self.path, self.fs, self.logger, self.suffix)
def run_trashput(self, *argv): cmd = TrashPutCmd(stdout=self.out, stderr=self.err, environ=self.environ, volume_of=self.fstab.volume_of, parent_path=os.path.dirname, realpath=lambda x: x, fs=RealFs(), getuid=lambda: None, now=datetime.now) self.exit_code = cmd.run(list(argv)) self.stderr = self.err.getvalue()
def run_trashput(self, *argv): self.environ = {'XDG_DATA_HOME': self.temp_dir / 'XDG_DATA_HOME'} self.out = StringIO() self.err = StringIO() cmd = TrashPutCmd(stdout=self.out, stderr=self.err, environ=self.environ, volumes=self.volumes, parent_path=os.path.dirname, realpath=lambda x: x, fs=RealFs(), getuid=lambda: None, now=datetime.now) self.exit_code = cmd.run(list(argv)) self.stdout = self.out.getvalue() self.stderr = self.err.getvalue()