From 65a3953c241cfe5b3c7af8bfd7e32d0e253a59f5 Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Wed, 19 Oct 2011 14:21:12 +0200 Subject: [PATCH] Add misc test functions --- wsme/tests/protocol.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wsme/tests/protocol.py b/wsme/tests/protocol.py index c785a93..d0555b3 100644 --- a/wsme/tests/protocol.py +++ b/wsme/tests/protocol.py @@ -213,11 +213,19 @@ class WithErrors(object): 1 / 0 +class MiscFunctions(object): + @expose(int) + @validate(int, int) + def multiply(self, a, b): + return a * b + + class WSTestRoot(WSRoot): argtypes = ArgTypes() returntypes = ReturnTypes() witherrors = WithErrors() nested = NestedOuterApi() + misc = MiscFunctions() def reset(self): self._touched = False @@ -410,6 +418,9 @@ class ProtocolTestCase(unittest.TestCase): assert e.faultcode == 'Client' assert e.faultstring == u'Missing argument: "value"' + def test_misc_multiply(self): + assert self.call('misc/multiply', a=5, b=2, _rt=int) == 10 + def test_html_format(self): res = self.call('argtypes/setdatetime', _accept="text/html", _no_result_decode=True)