diff options
author | Scott Maxwell <scott@codecobblers.com> | 2013-10-30 17:14:52 -0700 |
---|---|---|
committer | Scott Maxwell <scott@codecobblers.com> | 2013-10-30 17:14:52 -0700 |
commit | 0b7d0cf0a23e4f16f8552ae05a66539119e2e920 (patch) | |
tree | 2ba26a535dceb8b2684adedae99fdbc4c77b3a67 /tests/test_auth.py | |
parent | 2d738fa08b85c5065cc898d5f9e4d36ee753e871 (diff) |
Convert and detect types properly, use helper constants, use StringIO and range
Diffstat (limited to 'tests/test_auth.py')
-rw-r--r-- | tests/test_auth.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_auth.py b/tests/test_auth.py index a7c9e61b..5fd0bf5d 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -32,6 +32,11 @@ from paramiko import OPEN_SUCCEEDED, OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED from tests.loop import LoopSocket from tests.util import test_path +try: + _pwd = u'\u2022' +except Exception: + _pwd = '\u2022' + class NullServer (ServerInterface): paranoid_did_password = False @@ -65,7 +70,7 @@ class NullServer (ServerInterface): if self.paranoid_did_public_key: return AUTH_SUCCESSFUL return AUTH_PARTIALLY_SUCCESSFUL - if (username == 'utf8') and (password == u'\u2022'): + if (username == 'utf8') and (password == _pwd): return AUTH_SUCCESSFUL if (username == 'non-utf8') and (password == '\xff'): return AUTH_SUCCESSFUL @@ -203,7 +208,7 @@ class AuthTest (unittest.TestCase): """ self.start_server() self.tc.connect(hostkey=self.public_host_key) - remain = self.tc.auth_password('utf8', u'\u2022') + remain = self.tc.auth_password('utf8', _pwd) self.assertEquals([], remain) self.verify_finished() |