summaryrefslogtreecommitdiffhomepage
path: root/tests/test_auth.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2016-11-30 20:02:20 -0800
committerJeff Forcier <jeff@bitprophet.org>2016-11-30 20:02:20 -0800
commit9aec0c6300686e571fab5405c52876e6399f92e9 (patch)
tree8521aae70c6ebe889b92cbb9db69fd632f0fed08 /tests/test_auth.py
parent2a568863bb462fbae50fdd4795bf4d3e05e101bb (diff)
parent7366f965546c015c3f9e9dd1ccb8f0b7b8758dae (diff)
Merge branch 'master' into 398-int
Diffstat (limited to 'tests/test_auth.py')
-rw-r--r--tests/test_auth.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_auth.py b/tests/test_auth.py
index 1d972d53..23517790 100644
--- a/tests/test_auth.py
+++ b/tests/test_auth.py
@@ -83,13 +83,13 @@ class NullServer (ServerInterface):
return AUTH_SUCCESSFUL
return AUTH_PARTIALLY_SUCCESSFUL
return AUTH_FAILED
-
+
def check_auth_interactive(self, username, submethods):
if username == 'commie':
self.username = username
return InteractiveQuery('password', 'Please enter a password.', ('Password', False))
return AUTH_FAILED
-
+
def check_auth_interactive_response(self, responses):
if self.username == 'commie':
if (len(responses) == 1) and (responses[0] == 'cat'):
@@ -111,19 +111,19 @@ class AuthTest (unittest.TestCase):
self.ts.close()
self.socks.close()
self.sockc.close()
-
+
def start_server(self):
host_key = RSAKey.from_private_key_file(test_path('test_rsa.key'))
self.public_host_key = RSAKey(data=host_key.asbytes())
self.ts.add_server_key(host_key)
self.event = threading.Event()
self.server = NullServer()
- self.assertTrue(not self.event.isSet())
+ self.assertTrue(not self.event.is_set())
self.ts.start_server(self.event, self.server)
-
+
def verify_finished(self):
self.event.wait(1.0)
- self.assertTrue(self.event.isSet())
+ self.assertTrue(self.event.is_set())
self.assertTrue(self.ts.is_active())
def test_1_bad_auth_type(self):
@@ -156,7 +156,7 @@ class AuthTest (unittest.TestCase):
self.assertTrue(issubclass(etype, AuthenticationException))
self.tc.auth_password(username='slowdive', password='pygmalion')
self.verify_finished()
-
+
def test_3_multipart_auth(self):
"""
verify that multipart auth works.
@@ -187,7 +187,7 @@ class AuthTest (unittest.TestCase):
self.assertEqual(self.got_prompts, [('Password', False)])
self.assertEqual([], remain)
self.verify_finished()
-
+
def test_5_interactive_auth_fallback(self):
"""
verify that a password auth attempt will fallback to "interactive"