Skip to content

Commit

Permalink
Renamed bottle into self.app to not make confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHuot committed Jul 26, 2018
1 parent bd71fd6 commit a687ebe
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/test_oauth2.py
Expand Up @@ -15,31 +15,31 @@ 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'

with self.assertRaises(AssertionError):
test()

def test_verify_request(self):
@bottle.route('/foo')
@self.app.route('/foo')
@self.oauth.verify_request()
def test(): return 'bar'

with self.assertRaises(AssertionError):
test()

def test_create_authorization_response(self):
@bottle.route('/foo')
@self.app.route('/foo')
@self.oauth.create_authorization_response()
def test(): return 'bar'

with self.assertRaises(AssertionError):
test()

def test_create_introspect_response(self):
@bottle.route('/foo')
@self.app.route('/foo')
@self.oauth.create_introspect_response()
def test(): return 'bar'

Expand All @@ -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')
Expand All @@ -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")
Expand All @@ -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

Expand All @@ -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="

Expand All @@ -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

Expand All @@ -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}"

Expand All @@ -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

Expand All @@ -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="

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a687ebe

Please sign in to comment.