Пример #1
0
 def test_callRemote_calls_attribute(self):
     class ExampleProxy:
         def ok(self, a, b, c=None):
             return (c, b, a)
     proxy = DeferredBlockingProxy(ExampleProxy())
     d = proxy.callRemote('ok', 2, 3, c=8)
     result = extract_result(d)
     self.assertEqual((8, 3, 2), result)
Пример #2
0
 def readv(self,
           relpath,
           offsets,
           adjust_for_latency=False,
           upper_limit=None):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.readv(relpath, offsets, adjust_for_latency,
                                     upper_limit))
Пример #3
0
    def test_callRemote_calls_attribute(self):
        class ExampleProxy:
            def ok(self, a, b, c=None):
                return (c, b, a)

        proxy = DeferredBlockingProxy(ExampleProxy())
        d = proxy.callRemote('ok', 2, 3, c=8)
        result = extract_result(d)
        self.assertEqual((8, 3, 2), result)
Пример #4
0
 def delete_tree(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.delete_tree(relpath))
Пример #5
0
 def get_bytes(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.get_bytes(relpath))
Пример #6
0
 def listable(self):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.listable())
Пример #7
0
 def local_realPath(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.local_realPath(relpath))
Пример #8
0
 def open_write_stream(self, relpath, mode=None):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.open_write_stream(relpath, mode))
Пример #9
0
 def lock_write(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.lock_write(relpath))
Пример #10
0
 def listable(self):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.listable())
Пример #11
0
 def readv(self, relpath, offsets, adjust_for_latency=False,
           upper_limit=None):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.readv(
             relpath, offsets, adjust_for_latency, upper_limit))
Пример #12
0
 def local_realPath(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.local_realPath(relpath))
Пример #13
0
 def put_file(self, relpath, f, mode=None):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.put_file(relpath, f, mode))
Пример #14
0
 def open_write_stream(self, relpath, mode=None):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.open_write_stream(relpath, mode))
Пример #15
0
 def mkdir(self, relpath, mode=None):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.mkdir(relpath, mode))
Пример #16
0
 def lock_write(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.lock_write(relpath))
Пример #17
0
 def list_dir(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.list_dir(relpath))
Пример #18
0
 def get_bytes(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.get_bytes(relpath))
Пример #19
0
 def iter_files_recursive(self):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.iter_files_recursive())
Пример #20
0
 def rename(self, rel_from, rel_to):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.rename(rel_from, rel_to))
Пример #21
0
 def list_dir(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.list_dir(relpath))
Пример #22
0
 def stat(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.stat(relpath))
Пример #23
0
 def mkdir(self, relpath, mode=None):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.mkdir(relpath, mode))
Пример #24
0
 def writeChunk(self, relpath, offset, data):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.writeChunk(relpath, offset, data))
Пример #25
0
 def put_file(self, relpath, f, mode=None):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.put_file(relpath, f, mode))
Пример #26
0
 def rename(self, rel_from, rel_to):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.rename(rel_from, rel_to))
Пример #27
0
 def writeChunk(self, relpath, offset, data):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.writeChunk(relpath, offset, data))
Пример #28
0
 def iter_files_recursive(self):
     """See `bzrlib.transport.Transport`."""
     return extract_result(
         self._async_transport.iter_files_recursive())
Пример #29
0
 def stat(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.stat(relpath))
 def test_success(self):
     # extract_result on a Deferred that has a result returns the result.
     val = self.factory.getUniqueString()
     deferred = defer.succeed(val)
     self.assertEqual(val, extract_result(deferred))
Пример #31
0
 def test_success(self):
     # extract_result on a Deferred that has a result returns the result.
     val = self.factory.getUniqueString()
     deferred = defer.succeed(val)
     self.assertEqual(val, extract_result(deferred))
Пример #32
0
 def delete_tree(self, relpath):
     """See `bzrlib.transport.Transport`."""
     return extract_result(self._async_transport.delete_tree(relpath))