Test nested controllers

This commit is contained in:
Christophe de Vienne
2011-10-19 14:13:35 +02:00
parent 7bb637acb1
commit d366efec11

View File

@@ -43,6 +43,16 @@ class NestedOuter(object):
self.inner = NestedInner(0) self.inner = NestedInner(0)
class NestedInnerApi(object):
@expose(bool)
def deepfunction(self):
return True
class NestedOuterApi(object):
inner = NestedInnerApi()
class ReturnTypes(object): class ReturnTypes(object):
@expose(str) @expose(str)
def getstr(self): def getstr(self):
@@ -207,6 +217,7 @@ class WSTestRoot(WSRoot):
argtypes = ArgTypes() argtypes = ArgTypes()
returntypes = ReturnTypes() returntypes = ReturnTypes()
witherrors = WithErrors() witherrors = WithErrors()
nested = NestedOuterApi()
def reset(self): def reset(self):
self._touched = False self._touched = False
@@ -386,6 +397,10 @@ class ProtocolTestCase(unittest.TestCase):
_rt=[NestedOuter]) _rt=[NestedOuter])
assert r == value assert r == value
def test_nested_api(self):
r = self.call('nested/inner/deepfunction', _rt=bool)
assert r is True
def test_missing_argument(self): def test_missing_argument(self):
try: try:
r = self.call('argtypes/setdatetime') r = self.call('argtypes/setdatetime')