summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-12-18 14:05:01 -0800
committerJeff Forcier <jeff@bitprophet.org>2017-12-31 16:10:47 -0500
commit038c49e20904c83cea79debaa1b38de7376e313e (patch)
tree98b5bc5f296adc7995b7e4323b1f92387cdfe1b6
parent6698017400e0e384c0112d237374e507dbb35da9 (diff)
downloadparamiko-038c49e20904c83cea79debaa1b38de7376e313e.tar.gz
Migrate more tests to new suite
-rw-r--r--tests/authentication.py24
-rw-r--r--tests/test_auth.py21
2 files changed, 21 insertions, 24 deletions
diff --git a/tests/authentication.py b/tests/authentication.py
index f308812f..2403af64 100644
--- a/tests/authentication.py
+++ b/tests/authentication.py
@@ -68,8 +68,11 @@ class None_:
assert trans.auth_none('nobody') == []
-class Password:
- pass
+class Password_:
+ def incorrect_password_raises_auth_exception(self, trans):
+ with raises(AuthenticationException):
+ trans.start_client()
+ trans.auth_password(username='slowdive', password='error')
class Interactive:
@@ -93,7 +96,22 @@ class EncryptedPubKey:
#
class ManyAuthsEnterOneAuthLeaves:
- pass
+ # TODO: touch this up, came from old suite
+ def incorrect_password_excepts(self, trans):
+ trans.start_client()
+ with raises(AuthenticationException):
+ trans.auth_password(username='slowdive', password='error')
+ trans.auth_password(username='slowdive', password='pygmalion')
+
+ def test_interactive_auth_fallback(self, trans):
+ """
+ verify that a password auth attempt will fallback to "interactive"
+ if password auth isn't supported but interactive is.
+ """
+ trans.start_client()
+ remains = trans.auth_password('commie', 'cat')
+ # TODO: actually test that interactive was used after password...
+ assert remains == []
#
diff --git a/tests/test_auth.py b/tests/test_auth.py
index b6158440..d7430ec9 100644
--- a/tests/test_auth.py
+++ b/tests/test_auth.py
@@ -29,27 +29,6 @@ from ._util import _support, slow, utf8_password
class TestPasswordAuth:
- # TODO: store as new suite along w/ successful password tests (The utf8
- # ones below I think)
- def test_bad_password(self, trans):
- """
- verify that a bad password gets the right exception, and that a retry
- with the right password works.
- """
- trans.connect()
- with raises(AuthenticationException):
- trans.auth_password(username='slowdive', password='error')
- trans.auth_password(username='slowdive', password='pygmalion')
-
- def test_interactive_auth_fallback(self, trans):
- """
- verify that a password auth attempt will fallback to "interactive"
- if password auth isn't supported but interactive is.
- """
- trans.connect()
- remains = trans.auth_password('commie', 'cat')
- assert remains == []
-
def test_auth_utf8(self, trans):
"""
verify that utf-8 encoding happens in authentication.