def mkdir(self, relpath, mode=None): if self._cwd == '/source/': raise errors.RedirectRequested(self.abspath(relpath), self.abspath('../target'), is_permanent=True) elif self._cwd == '/infinite-loop/': raise errors.RedirectRequested(self.abspath(relpath), self.abspath('../infinite-loop'), is_permanent=True) else: return super(RedirectingMemoryTransport, self).mkdir(relpath, mode)
def get(self, relpath): if self.clone(relpath)._cwd == '/infinite-loop/': raise errors.RedirectRequested(self.abspath(relpath), self.abspath('../infinite-loop'), is_permanent=True) else: return super(RedirectingMemoryTransport, self).get(relpath)