diff --git a/tests/test_oauth2.py b/tests/test_oauth2.py index c78445b..807341f 100644 --- a/tests/test_oauth2.py +++ b/tests/test_oauth2.py @@ -15,7 +15,7 @@ def setUp(self): self.oauth = BottleOAuth2(self.app) def test_create_token_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_token_response() def test(): return 'bar' @@ -23,7 +23,7 @@ def test(): return 'bar' test() def test_verify_request(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.verify_request() def test(): return 'bar' @@ -31,7 +31,7 @@ def test(): return 'bar' test() def test_create_authorization_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_authorization_response() def test(): return 'bar' @@ -39,7 +39,7 @@ def test(): return 'bar' test() def test_create_introspect_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_introspect_response() def test(): return 'bar' @@ -62,7 +62,7 @@ def setUp(self): ) def test_valid_request(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.verify_request() def test(): self.assertEqual(bottle.request.oauth['client'], 'foo') @@ -78,7 +78,7 @@ def test(): mocked.assert_called_once() def test_invalid_request(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.verify_request() def test(): self.assertTrue(False, "must never be here") @@ -102,7 +102,7 @@ def setUp(self): }, "a=b&c=d", "200 FooOK") def test_valid_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_token_response() def test(): return None @@ -115,7 +115,7 @@ def test(): return None mocked.assert_called_once() def test_override_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_token_response() def test(): return "my=custom&body=" @@ -142,7 +142,7 @@ def setUp(self): }, "{'valid': true, 'foo': 'bar'}", "200 FooOK") def test_valid_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_introspect_response() def test(): return None @@ -155,7 +155,7 @@ def test(): return None mocked.assert_called_once() def test_override_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_introspect_response() def test(): return "{'valid': false}" @@ -181,7 +181,7 @@ def setUp(self): }, "a=b&c=d", "200 FooOK") def test_valid_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_authorization_response() def test(): return None @@ -196,7 +196,7 @@ def test(): return None self.assertEqual(mocked.call_args[1]["scopes"], ['admin', 'view', 'write']) def test_override_response(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_authorization_response() def test(): return "my=custom&body=" @@ -210,7 +210,7 @@ def test(): return "my=custom&body=" mocked.assert_called_once() def test_fatal_error(self): - @bottle.route('/foo') + @self.app.route('/foo') @self.oauth.create_authorization_response() def test(): return None @@ -252,7 +252,7 @@ def setUp(self): self.fake_response = ({}, "", "200 fooOK") def test_valid_response(self): - @bottle.route('/revoke') + @self.app.route('/revoke') @self.oauth.create_revocation_response() def test(): return None