MCPcopy Create free account
hub / github.com/ryanmcgrath/twython / test_request_should_handle_401

Method test_request_should_handle_401

tests/test_core.py:221–227  ·  view source on GitHub ↗

Test that Twython raises an auth error on 401 error

(self)

Source from the content-addressed store, hash-verified

219
220 @responses.activate
221 def test_request_should_handle_401(self):
222 """Test that Twython raises an auth error on 401 error"""
223 endpoint = 'statuses/home_timeline'
224 url = self.get_url(endpoint)
225 self.register_response(responses.GET, url, body='{"errors":[{"message":"Error"}]}', status=401)
226
227 self.assertRaises(TwythonAuthError, self.api.request, endpoint)
228
229 @responses.activate
230 def test_request_should_handle_400_for_missing_auth_data(self):

Callers

nothing calls this directly

Calls 2

get_urlMethod · 0.95
register_responseMethod · 0.95

Tested by

no test coverage detected