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)