forked from getsentry/raven-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turns out, rate limiting is it's own exception
- Loading branch information
1 parent
ea53ddb
commit 6db3d8d
Showing
4 changed files
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,11 @@ | |
import time | ||
from socket import socket, AF_INET, SOCK_DGRAM | ||
from raven.base import Client, ClientState | ||
from raven.exceptions import RateLimited | ||
from raven.transport import AsyncTransport | ||
from raven.utils.stacks import iter_stack_frames | ||
from raven.utils import six | ||
from raven.utils.testutils import TestCase | ||
from raven.utils.compat import HTTPError | ||
|
||
|
||
class TempStoreClient(Client): | ||
|
@@ -122,12 +122,8 @@ def test_send_remote_failover_with_retry_after(self, should_try, send): | |
dsn='sync+http://public:[email protected]/1' | ||
) | ||
|
||
e = HTTPError( | ||
'http://example.com/api/store', 429, 'oops', | ||
{'Retry-After': '5'}, six.StringIO()) | ||
|
||
# test error | ||
send.side_effect = e | ||
send.side_effect = RateLimited('foo', 5) | ||
client.send_remote('sync+http://example.com/api/store', 'foo') | ||
self.assertEquals(client.state.status, client.state.ERROR) | ||
self.assertEqual(client.state.retry_after, 5) | ||
|