Skip to content

Commit

Permalink
add test case and update VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
mission-liao committed May 7, 2015
1 parent 1ba598c commit b8d5bd0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyswagger/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.8
0.8.9
6 changes: 6 additions & 0 deletions pyswagger/tests/v1_2/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions pyswagger/tests/v2_0/test_op_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)

0 comments on commit b8d5bd0

Please sign in to comment.