diff options
Diffstat (limited to 'tests/auth.py')
-rw-r--r-- | tests/auth.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auth.py b/tests/auth.py index bd81578a..4ede3240 100644 --- a/tests/auth.py +++ b/tests/auth.py @@ -11,6 +11,7 @@ from pytest import raises from paramiko import ( AgentKey, AuthenticationException, + AuthFailure, AuthResult, AuthSource, AuthStrategy, @@ -492,5 +493,23 @@ class AuthResult_: assert str(result) == "NoneAuth() -> success" +class AuthFailure_: + def is_an_AuthenticationException(self): + assert isinstance(AuthFailure(None), AuthenticationException) + + def init_requires_result(self): + with raises(TypeError): + AuthFailure() + result = AuthResult(None) + fail = AuthFailure(result=result) + assert fail.result is result + + def str_is_newline_plus_result_str(self): + result = AuthResult(None) + result.append(SourceResult(NoneAuth("foo"), Exception("onoz"))) + fail = AuthFailure(result) + assert str(fail) == "\nNoneAuth() -> onoz" + + class AuthStrategy_: pass |