import time
from unittest import TestCase

from OpenSSL.SSL import SysCallError

from pandora.py2compat import Mock, call

from tests.test_pandora.test_clientbuilder import TestSettingsDictBuilder


class TestTransport(TestCase):

    def test_call_should_retry_max_times_on_sys_call_error(self):
        with self.assertRaises(SysCallError):

            client = TestSettingsDictBuilder._build_minimal()

            time.sleep = Mock()
            client.transport._make_http_request = Mock(side_effect=SysCallError("mock_error"))
            client.transport._start_request = Mock()

            client("method")

        client.transport._start_request.assert_has_calls([call("method")])
        assert client.transport._start_request.call_count == 5

@@ -40,46 +40,8 @@
 se%0A%0A
-from OpenSSL.SSL import SysCallError%0A%0A
 from
@@ -77,16 +77,16 @@
 k, call%0A
+
 %0Afrom te
@@ -154,16 +154,58 @@
 ilder%0A%0A%0A
+class SysCallError(Exception):%0A    pass%0A%0A%0A
 class Te
@@ -340,17 +340,16 @@
 Error):%0A
-%0A
         
@@ -435,16 +435,16 @@
  Mock()%0A
-
         
@@ -490,16 +490,37 @@
  = Mock(
+%0A                    
 side_eff

Fix SysCallError test