aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjcass <john.cass77@gmail.com>2016-01-12 18:08:08 +0200
committerjcass <john.cass77@gmail.com>2016-01-12 18:08:08 +0200
commit296c91c836ad41a5130711bcd6f30117a4c48265 (patch)
tree78300d0b5c4f444e6a5fbad8dca1d6a191f83450 /tests
parent4349a4a92f2c0581531b10fd39b6a938ef465d57 (diff)
downloadpydora-296c91c836ad41a5130711bcd6f30117a4c48265.tar.bz2
pydora-296c91c836ad41a5130711bcd6f30117a4c48265.tar.xz
pydora-296c91c836ad41a5130711bcd6f30117a4c48265.zip
Remove unreachable code. Test case for avoiding retries on PandoraException being raised.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pandora/test_transport.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_pandora/test_transport.py b/tests/test_pandora/test_transport.py
index 6596a0e..394916b 100644
--- a/tests/test_pandora/test_transport.py
+++ b/tests/test_pandora/test_transport.py
@@ -1,5 +1,6 @@
1import time 1import time
2from unittest import TestCase 2from unittest import TestCase
3from pandora.errors import PandoraException
3 4
4from pandora.py2compat import Mock, call 5from pandora.py2compat import Mock, call
5 6
@@ -25,3 +26,16 @@ class TestTransport(TestCase):
25 26
26 client.transport._start_request.assert_has_calls([call("method")]) 27 client.transport._start_request.assert_has_calls([call("method")])
27 assert client.transport._start_request.call_count == 5 28 assert client.transport._start_request.call_count == 5
29
30 def test_call_should_not_retry_for_pandora_exceptions(self):
31 client = TestSettingsDictBuilder._build_minimal()
32
33 time.sleep = Mock()
34 client.transport._make_http_request = Mock(
35 side_effect=PandoraException("error_mock"))
36 client.transport._start_request = Mock()
37
38 client("method")
39
40 client.transport._start_request.assert_has_calls([call("method")])
41 assert client.transport._start_request.call_count == 1