aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2015-12-05 22:40:14 -0800
committerMike Crute <mcrute@gmail.com>2015-12-05 22:40:14 -0800
commit2314e33faf6265d279c53396c07740e6ee4aa5c1 (patch)
tree804f4a5851cae9f68bfa39b24d51c3e15b33fe8b /tests
parent62c15a0a45a2f2e086ba71585a0915f88ea7c337 (diff)
downloadpydora-2314e33faf6265d279c53396c07740e6ee4aa5c1.tar.bz2
pydora-2314e33faf6265d279c53396c07740e6ee4aa5c1.tar.xz
pydora-2314e33faf6265d279c53396c07740e6ee4aa5c1.zip
Fix SysCallError test
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pandora/test_transport.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_pandora/test_transport.py b/tests/test_pandora/test_transport.py
index 746a6f6..59d4cea 100644
--- a/tests/test_pandora/test_transport.py
+++ b/tests/test_pandora/test_transport.py
@@ -1,22 +1,24 @@
1import time 1import time
2from unittest import TestCase 2from unittest import TestCase
3 3
4from OpenSSL.SSL import SysCallError
5
6from pandora.py2compat import Mock, call 4from pandora.py2compat import Mock, call
7 5
8from tests.test_pandora.test_clientbuilder import TestSettingsDictBuilder 6from tests.test_pandora.test_clientbuilder import TestSettingsDictBuilder
9 7
10 8
9class SysCallError(Exception):
10 pass
11
12
11class TestTransport(TestCase): 13class TestTransport(TestCase):
12 14
13 def test_call_should_retry_max_times_on_sys_call_error(self): 15 def test_call_should_retry_max_times_on_sys_call_error(self):
14 with self.assertRaises(SysCallError): 16 with self.assertRaises(SysCallError):
15
16 client = TestSettingsDictBuilder._build_minimal() 17 client = TestSettingsDictBuilder._build_minimal()
17 18
18 time.sleep = Mock() 19 time.sleep = Mock()
19 client.transport._make_http_request = Mock(side_effect=SysCallError("mock_error")) 20 client.transport._make_http_request = Mock(
21 side_effect=SysCallError("mock_error"))
20 client.transport._start_request = Mock() 22 client.transport._start_request = Mock()
21 23
22 client("method") 24 client("method")