Tornado XML-RPC server and client
Project description
XML-RPC server and client implementation based on tornado. Using lxml and AsyncHttpClient.
Example:
from tornado_xmlrpc import handler, client
from tornado.testing import *
class XMLRPCTestHandler(handler.XMLRPCHandler):
def rpc_test(self):
return None
def rpc_args(self, *args):
return len(args)
def rpc_kwargs(self, **kwargs):
return len(kwargs)
def rpc_args_kwargs(self, *args, **kwargs):
return len(args) + len(kwargs)
def rpc_exception(self):
raise Exception("YEEEEEE!!!")
class TestSimple(tornado.testing.AsyncHTTPTestCase):
def setUp(self):
super(TestSimple, self).setUp()
self.server = client.ServerProxy("http://localhost:%d" % self.get_http_port())
def tearDown(self):
super(TestSimple, self).tearDown()
self.server = None
def get_app(self):
return Application(handlers=[
('/', XMLRPCTestHandler),
])
@gen_test
def test_00_test(self):
result = yield self.server.test()
self.assertIsNone(result)
@gen_test
def test_10_args(self):
result = yield self.server.args(1, 2, 3, 4, 5)
self.assertEqual(result, 5)
@gen_test
def test_20_kwargs(self):
result = yield self.server.kwargs(foo=1, bar=2)
self.assertEqual(result, 2)
@gen_test
def test_20_kwargs(self):
result = yield self.server.args_kwargs(1, 2, 3, 4, 5, foo=1, bar=2)
self.assertEqual(result, 7)
@gen_test
def test_30_exception(self):
try:
yield self.server.exception()
except client.RemoteServerException as e:
self.assertIn("YEEEEEE!!!", e.message)
else:
raise RuntimeError("No exception")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tornado-xmlrpc-1.0.tar.gz
(6.1 kB
view details)
Built Distributions
tornado_xmlrpc-1.0-py3.5.egg
(13.6 kB
view details)
tornado_xmlrpc-1.0-py2.7.egg
(13.3 kB
view details)
File details
Details for the file tornado-xmlrpc-1.0.tar.gz
.
File metadata
- Download URL: tornado-xmlrpc-1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 696ef763bf65d99597457f81507698379175037f773109b256438c78c484e468 |
|
MD5 | e23141d75d0a93fd8b73f6d8ab40fedf |
|
BLAKE2b-256 | 8905cfeea7d4338a89e7f731143e7276e07cdd73e9dfd4b08e4a34c94612368d |
File details
Details for the file tornado_xmlrpc-1.0-py3.5.egg
.
File metadata
- Download URL: tornado_xmlrpc-1.0-py3.5.egg
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5586c4f400e215d5ca89eb298a068488d40f3011acb06c320782d67079f8a2c0 |
|
MD5 | cb3fbf2356c7b61c75f4ae56f9b62ead |
|
BLAKE2b-256 | 30a82f87aeb79f7ea1639c5a389ba7641884b0d5b9fdb2d1fe3c74b036170beb |
File details
Details for the file tornado_xmlrpc-1.0-py3-none-any.whl
.
File metadata
- Download URL: tornado_xmlrpc-1.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df21f08a852b5e8301967997565bd7b8b2da9375ee4e9c13bf47ee6c691b3bfb |
|
MD5 | 906f6662f78a24b1e90d61bd760610ba |
|
BLAKE2b-256 | b46334b72e94b32470fd48ae464e260a7c676c04fdddf91c09d6b0617b8d7365 |
File details
Details for the file tornado_xmlrpc-1.0-py2.7.egg
.
File metadata
- Download URL: tornado_xmlrpc-1.0-py2.7.egg
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 510171745d09b275a44a9da12d6e9f50d04ad2011c47e71f1b20ddddc33896e6 |
|
MD5 | 3cb1a40ad4d978d9082b87a5cc9605b7 |
|
BLAKE2b-256 | 066635db0692582ce717226d5b259fd0a69ce9243be61e0944e17011fa28cd4c |
File details
Details for the file tornado_xmlrpc-1.0-py2-none-any.whl
.
File metadata
- Download URL: tornado_xmlrpc-1.0-py2-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dfc02a23fb64c130977dcc7405d4c56a09bc30e41586f3b7ecefd5e37c6091e |
|
MD5 | 219c31e73cc89610304e3762a7a85a3a |
|
BLAKE2b-256 | 6d788df4f8ae5cfcc4251f73235f8c2a809dc4f0f8927864ebc37b9bb27e43ab |
File details
Details for the file tornado-xmlrpc-1.0.macosx-10.11-x86_64.tar.gz
.
File metadata
- Download URL: tornado-xmlrpc-1.0.macosx-10.11-x86_64.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9367c0fafd1c78b1a0ac3e93b109f61d83f30d3bfaa6206aedeea2b93cfb527c |
|
MD5 | 362e682bfe100f5774f09a9e67515f2f |
|
BLAKE2b-256 | a0926f6dc65643741d275ee6b7ea1238e3abb320e335062f87d0b2f06ebdc608 |