@@ -109,18 +109,24 @@ def test__retry_ratelimit_error_Should_Return_False_When_NotHttpError(self, *pat
109109
110110 self .assertFalse (GitHubAPI .retry_ratelimit_error (Exception ('test' )))
111111
112- def test__retry_ratelimit_error_Should_Return_True_When_HttpErrorNoStatusCodeMatch (self , * patches ):
112+ def test__retry_ratelimit_error_Should_Return_False_When_HttpErrorNoStatusCodeMatch (self , * patches ):
113113 response_mock = Mock (status_code = 404 )
114114 http_error_mock = HTTPError (Mock ())
115115 http_error_mock .response = response_mock
116116 self .assertFalse (GitHubAPI .retry_ratelimit_error (http_error_mock ))
117117
118118 def test__retry_ratelimit_error_Should_Return_True_When_Match (self , * patches ):
119- response_mock = Mock (status_code = 403 )
119+ response_mock = Mock (status_code = 403 , reason = 'API Rate Limit Exceeded' )
120120 http_error_mock = HTTPError (Mock ())
121121 http_error_mock .response = response_mock
122122 self .assertTrue (GitHubAPI .retry_ratelimit_error (http_error_mock ))
123123
124+ def test__retry_ratelimit_error_Should_Return_False_When_403NotRateLimit (self , * patches ):
125+ response_mock = Mock (status_code = 403 , reason = 'Forbidden' )
126+ http_error_mock = HTTPError (Mock ())
127+ http_error_mock .response = response_mock
128+ self .assertFalse (GitHubAPI .retry_ratelimit_error (http_error_mock ))
129+
124130 @patch ('github3api.githubapi.GitHubAPI.log_ratelimit' )
125131 @patch ('github3api.githubapi.GitHubAPI.get_ratelimit' )
126132 def test__get_response_Should_CallExpected_When_RateLimit (self , get_ratelimit_patch , log_ratelimit_patch , * patches ):
0 commit comments