Skip to content

Commit 889cff8

Browse files
committed
unittests now use my Test class
1 parent 90ac97b commit 889cff8

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

oauth2_bottle_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
oauth2_app = Bottle(catchall=False, autojson=True)
1212

13-
__version__ = '0.0.8'
13+
__version__ = '0.0.9'
1414

1515

1616
def oauth2_error_catcher(environ, start_response):

tests.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from unittest import TestCase, main as unittest_main
22

33
from webtest import TestApp, AppError
4+
from namespace_utils.test_class import Test
45

56
from oauth2_bottle_app import oauth2_app
67

@@ -65,7 +66,6 @@ def test_3_register_or_login_success_register(self):
6566
# Save access token
6667
self.__class__.access_token = register_or_login_resp.json['access_token']
6768

68-
6969
def test_3_register_or_login_failure_login(self):
7070
bad_user = self.users[1].copy()
7171
bad_user['password'] = 'fooooooooooo wrong'
@@ -117,17 +117,14 @@ def test_5_logout_success(self):
117117
self.assertItemsEqual(('error', 'error_description'), tok_resp.json.keys())
118118
self.assertNotEqual(tok_resp.status_code, 200)
119119

120-
@classmethod
121-
def assert_equal(cls, expect, got):
122-
assert expect == got, "Expected: '{0}', got '{1}'".format(expect, got)
123-
124120
@classmethod
125121
def tearDownClass(cls):
126122
unregister_resps = (cls.app.delete('/api/oauth2/unregister', params=cls.users[1]),
127123
cls.app.delete('/api/oauth2/unregister', params=cls.users[2]))
128124
for unregister_resp in unregister_resps:
129-
cls.assert_equal(got=unregister_resp.content_type, expect=None)
130-
cls.assert_equal(got=unregister_resp.status, expect="204 No Content")
125+
self = Test()
126+
self.assertEqual(got=unregister_resp.content_type, expect=None)
127+
self.assertEqual(got=unregister_resp.status, expect="204 No Content")
131128

132129

133130
if __name__ == '__main__':

0 commit comments

Comments
 (0)