From f3e8a2435bacc6acf201db16578612faff660988 Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Tue, 11 Oct 2011 14:06:41 +0200 Subject: [PATCH] Improve code coverage of restjson --- wsme/tests/test_restjson.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wsme/tests/test_restjson.py b/wsme/tests/test_restjson.py index 20b7fec..7580474 100644 --- a/wsme/tests/test_restjson.py +++ b/wsme/tests/test_restjson.py @@ -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} +