Code Duplication    Length = 10-10 lines in 2 locations

tests/test_oauth.py 2 locations

@@ 136-145 (lines=10) @@
133
            res = self.oauth.get_user_info()
134
            self.assertEqual('OPENID', res['openid'])
135
136
    def test_reraise_requests_exception(self):
137
        @urlmatch(netloc=r'(.*\.)?api\.weixin\.qq\.com$')
138
        def _wechat_api_mock(url, request):
139
            return {'status_code': 404, 'content': '404 not found'}
140
141
        try:
142
            with HTTMock(_wechat_api_mock):
143
                self.oauth.fetch_access_token('123456')
144
        except WeChatClientException as e:
145
            self.assertEqual(404, e.response.status_code)
146
@@ 86-95 (lines=10) @@
83
            res = self.oauth.check_access_token()
84
            self.assertEqual(True, res)
85
86
    def test_reraise_requests_exception(self):
87
        @urlmatch(netloc=r'(.*\.)?api\.weixin\.qq\.com$')
88
        def _wechat_api_mock(url, request):
89
            return {'status_code': 404, 'content': '404 not found'}
90
91
        try:
92
            with HTTMock(_wechat_api_mock):
93
                self.oauth.fetch_access_token('123456')
94
        except WeChatClientException as e:
95
            self.assertEqual(404, e.response.status_code)
96
97
98
class ComponentOAuthTestCase(unittest.TestCase):