summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2016-04-24 14:00:44 -0700
committerJeff Forcier <jeff@bitprophet.org>2016-04-24 14:00:44 -0700
commitd3af63ac5edc06cb07ad3f2afb5a30a2f79713b6 (patch)
tree02ccfa95d8bc0800a2dfc79d941aac1bf21b1bf4
parent6c1539bbf7046e5e3d1f20725baa1ae48d1b7ce3 (diff)
Python 2.6 fix re: assertIn
-rw-r--r--tests/test_ssh_exception.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_ssh_exception.py b/tests/test_ssh_exception.py
index 9c109de1..18f2a97d 100644
--- a/tests/test_ssh_exception.py
+++ b/tests/test_ssh_exception.py
@@ -16,15 +16,16 @@ class NoValidConnectionsErrorTest (unittest.TestCase):
def test_error_message_for_single_host(self):
exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception()})
- self.assertIn("Unable to connect to port 22 on 127.0.0.1", str(exc))
+ assert "Unable to connect to port 22 on 127.0.0.1" in str(exc)
def test_error_message_for_two_hosts(self):
exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception(),
('::1', '22'): Exception()})
- self.assertIn("Unable to connect to port 22 on 127.0.0.1 or ::1", str(exc))
+ assert "Unable to connect to port 22 on 127.0.0.1 or ::1" in str(exc)
def test_error_message_for_multiple_hosts(self):
exc = NoValidConnectionsError({('127.0.0.1', '22'): Exception(),
('::1', '22'): Exception(),
('10.0.0.42', '22'): Exception()})
- self.assertIn("Unable to connect to port 22 on 10.0.0.42, 127.0.0.1 or ::1", str(exc))
+ exp = "Unable to connect to port 22 on 10.0.0.42, 127.0.0.1 or ::1"
+ assert exp in str(exc)