|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
diff --git a/dev-requirements.txt b/dev-requirements.txt
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
index f4f84748..b1b0cdf5 100644
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
--- a/dev-requirements.txt
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+++ b/dev-requirements.txt
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
@@ -2,7 +2,6 @@
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
invoke>=1.0,<2.0
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
invocations>=1.2.0,<2.0
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
pytest==4.4.2
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
-pytest-relaxed==1.1.5
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
# pytest-xdist for test dir watching and the inv guard task
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
pytest-xdist==1.28.0
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
mock==2.0.0
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
diff --git a/setup.cfg b/setup.cfg
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
index 44d029c4..99159096 100644
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
--- a/setup.cfg
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+++ b/setup.cfg
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
@@ -17,9 +17,6 @@ ignore = E124,E125,E128,E261,E301,E302,E303,E402,E721,W503,E203,E722
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
max-line-length = 79
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
[tool:pytest]
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
-# We use pytest-relaxed just for its utils at the moment, so disable it at the
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
-# plugin level until we adapt test organization to really use it.
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
-addopts = -p no:relaxed
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
# Loop on failure
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
looponfailroots = tests paramiko
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
# Ignore some warnings we cannot easily handle.
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
diff --git a/tests/test_client.py b/tests/test_client.py
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
index 60ad310c..88fd1d53 100644
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
--- a/tests/test_client.py
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+++ b/tests/test_client.py
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
@@ -33,7 +33,7 @@ import warnings
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
import weakref
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
from tempfile import mkstemp
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
-from pytest_relaxed import raises
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+import pytest
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
from mock import patch, Mock
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
import paramiko
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
@@ -684,10 +684,10 @@ class PasswordPassphraseTests(ClientTest):
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
# TODO: more granular exception pending #387; should be signaling "no auth
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
# methods available" because no key and no password
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- @raises(SSHException)
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
def test_passphrase_kwarg_not_used_for_password_auth(self):
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- # Using the "right" password in the "wrong" field shouldn't work.
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- self._test_connection(passphrase="pygmalion")
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ with pytest.raises(SSHException):
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ # Using the "right" password in the "wrong" field shouldn't work.
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ self._test_connection(passphrase="pygmalion")
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
def test_passphrase_kwarg_used_for_key_passphrase(self):
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
# Straightforward again, with new passphrase kwarg.
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
@@ -705,14 +705,14 @@ class PasswordPassphraseTests(ClientTest):
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
password="television",
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
)
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- @raises(AuthenticationException) # TODO: more granular
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
def test_password_kwarg_not_used_for_passphrase_when_passphrase_kwarg_given( # noqa
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
self
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
):
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
# Sanity: if we're given both fields, the password field is NOT used as
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
# a passphrase.
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- self._test_connection(
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- key_filename=_support("test_rsa_password.key"),
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- password="television",
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- passphrase="wat? lol no",
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
- )
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ with pytest.raises(AuthenticationException):
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ self._test_connection(
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ key_filename=_support("test_rsa_password.key"),
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ password="television",
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ passphrase="wat? lol no",
|
|
![](https://seccdn.libravatar.org/avatar/27d986ce2ac90386c54ece8f298af68394ba0075c486ba984fb8cdabef9a5abe?s=16&d=retro) |
128040 |
+ )
|