示例#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))