diff options
Diffstat (limited to 'tests/test_util.py')
-rw-r--r-- | tests/test_util.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/test_util.py b/tests/test_util.py index 1c276f8d..ec03846b 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -21,7 +21,6 @@ Some unit tests for utility functions. """ from binascii import hexlify -import errno import os from hashlib import sha1 import unittest @@ -108,39 +107,6 @@ class UtilTest(unittest.TestCase): finally: os.unlink("hostfile.temp") - def test_eintr_retry(self): - assert "foo" == paramiko.util.retry_on_signal(lambda: "foo") - - # Variables that are set by raises_intr - intr_errors_remaining = [3] - call_count = [0] - - def raises_intr(): - call_count[0] += 1 - if intr_errors_remaining[0] > 0: - intr_errors_remaining[0] -= 1 - raise IOError(errno.EINTR, "file", "interrupted system call") - - self.assertTrue(paramiko.util.retry_on_signal(raises_intr) is None) - assert 0 == intr_errors_remaining[0] - assert 4 == call_count[0] - - def raises_ioerror_not_eintr(): - raise IOError(errno.ENOENT, "file", "file not found") - - self.assertRaises( - IOError, - lambda: paramiko.util.retry_on_signal(raises_ioerror_not_eintr), - ) - - def raises_other_exception(): - raise AssertionError("foo") - - self.assertRaises( - AssertionError, - lambda: paramiko.util.retry_on_signal(raises_other_exception), - ) - def test_clamp_value(self): assert 32768 == paramiko.util.clamp_value(32767, 32768, 32769) assert 32767 == paramiko.util.clamp_value(32767, 32765, 32769) |