From b8d5bd05f31d867fc3857efb2033e52fbe0aaf0d Mon Sep 17 00:00:00 2001 From: Mission Liao Date: Thu, 7 May 2015 15:40:47 +0800 Subject: [PATCH] add test case and update VERSION --- pyswagger/VERSION | 2 +- pyswagger/tests/v1_2/test_app.py | 6 ++++++ pyswagger/tests/v2_0/test_op_access.py | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pyswagger/VERSION b/pyswagger/VERSION index 6201b5f..55485e1 100644 --- a/pyswagger/VERSION +++ b/pyswagger/VERSION @@ -1 +1 @@ -0.8.8 +0.8.9 diff --git a/pyswagger/tests/v1_2/test_app.py b/pyswagger/tests/v1_2/test_app.py index 638b0e2..5225fef 100644 --- a/pyswagger/tests/v1_2/test_app.py +++ b/pyswagger/tests/v1_2/test_app.py @@ -135,6 +135,12 @@ def _hook(url): self.app = SwaggerApp.load('http://petstore.io/wordnik', url_load_hook=_hook) self.app.prepare() + def test_url(self): + """ make sure url is not touched by hook """ + req, _ = self.app.op['getUserByName'](username='Tom') + req.prepare() + self.assertEqual(req.url, 'http://petstore.swagger.wordnik.com/api/user/Tom') + def test_ref(self): """ test ref function """ self.assertRaises(ValueError, self.app.resolve, None) diff --git a/pyswagger/tests/v2_0/test_op_access.py b/pyswagger/tests/v2_0/test_op_access.py index 86808c8..26a4a3a 100644 --- a/pyswagger/tests/v2_0/test_op_access.py +++ b/pyswagger/tests/v2_0/test_op_access.py @@ -39,3 +39,9 @@ def test_shortcut(self): _check(self, self.app.s('pet').post) _check(self, self.app.s('pet', b=SwaggerApp._shortcut_[SwaggerApp.sc_path]).post) + def test_special_char(self): + """ when the path has '{' and '}' """ + self.assertEqual( + self.app.resolve(utils.jp_compose(['#', 'paths', '/user/{username}'])).get.operationId, + 'getUserByName' + )