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)
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))
def delete_tree(self, relpath): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.delete_tree(relpath))
def get_bytes(self, relpath): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.get_bytes(relpath))
def listable(self): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.listable())
def local_realPath(self, relpath): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.local_realPath(relpath))
def open_write_stream(self, relpath, mode=None): """See `bzrlib.transport.Transport`.""" return extract_result( self._async_transport.open_write_stream(relpath, mode))
def lock_write(self, relpath): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.lock_write(relpath))
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))
def local_realPath(self, relpath): """See `bzrlib.transport.Transport`.""" return extract_result( self._async_transport.local_realPath(relpath))
def put_file(self, relpath, f, mode=None): """See `bzrlib.transport.Transport`.""" return extract_result( self._async_transport.put_file(relpath, f, mode))
def mkdir(self, relpath, mode=None): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.mkdir(relpath, mode))
def list_dir(self, relpath): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.list_dir(relpath))
def iter_files_recursive(self): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.iter_files_recursive())
def rename(self, rel_from, rel_to): """See `bzrlib.transport.Transport`.""" return extract_result( self._async_transport.rename(rel_from, rel_to))
def stat(self, relpath): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.stat(relpath))
def writeChunk(self, relpath, offset, data): """See `bzrlib.transport.Transport`.""" return extract_result( self._async_transport.writeChunk(relpath, offset, data))
def put_file(self, relpath, f, mode=None): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.put_file(relpath, f, mode))
def rename(self, rel_from, rel_to): """See `bzrlib.transport.Transport`.""" return extract_result(self._async_transport.rename(rel_from, rel_to))
def iter_files_recursive(self): """See `bzrlib.transport.Transport`.""" return extract_result( self._async_transport.iter_files_recursive())
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))