amends 1ea5bc68101a7f4075553df49fe58ba0b250316b
This commit is contained in:
parent
d8355f1cdf
commit
16f75d19e4
@ -191,10 +191,15 @@ class TestController(unittest.TestCase):
|
|||||||
return a * b
|
return a * b
|
||||||
|
|
||||||
mul_int = expose(int, int, int, wrap=True)(multiply)
|
mul_int = expose(int, int, int, wrap=True)(multiply)
|
||||||
|
|
||||||
mul_float = expose(
|
mul_float = expose(
|
||||||
float, float, float,
|
float, float, float,
|
||||||
wrap=True)(multiply)
|
wrap=True)(multiply)
|
||||||
|
|
||||||
|
mul_string = expose(
|
||||||
|
wsme.types.text, wsme.types.text, int,
|
||||||
|
wrap=True)(multiply)
|
||||||
|
|
||||||
r = MyRoot(['restjson'])
|
r = MyRoot(['restjson'])
|
||||||
|
|
||||||
app = webtest.TestApp(r.wsgiapp())
|
app = webtest.TestApp(r.wsgiapp())
|
||||||
@ -211,6 +216,12 @@ class TestController(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertEquals(res.body, '8.8')
|
self.assertEquals(res.body, '8.8')
|
||||||
|
|
||||||
|
res = app.get('/mul_string?a=hello&b=2', headers={
|
||||||
|
'Accept': 'application/json'
|
||||||
|
})
|
||||||
|
|
||||||
|
self.assertEquals(res.body, '"hellohello"')
|
||||||
|
|
||||||
|
|
||||||
class TestFunctionDefinition(unittest.TestCase):
|
class TestFunctionDefinition(unittest.TestCase):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user