Improve code coverage of restjson

This commit is contained in:
Christophe de Vienne
2011-10-11 14:06:41 +02:00
parent e734bbf2a0
commit f3e8a2435b

View File

@@ -9,6 +9,7 @@ except:
import json
import wsme.protocols.restjson
from wsme.protocols.restjson import fromjson
from wsme.utils import *
@@ -87,3 +88,11 @@ class TestRestJson(wsme.tests.protocol.ProtocolTestCase):
r.get('debuginfo'))
return json.loads(res.body)
def test_fromjson(self):
assert fromjson(str, None) == None
def test_keyargs(self):
r = self.app.get('/argtypes/setint.json?value=2')
assert json.loads(r.body) == {'result': 2}