summaryrefslogtreecommitdiff
path: root/tests/test_config.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2019-12-03 10:29:18 -0500
committerJeff Forcier <jeff@bitprophet.org>2019-12-03 10:50:46 -0500
commit1919964110333aa91df3e33424b763384bea127f (patch)
treeb8f2c51122707e018c05399820c89f90a9859931 /tests/test_config.py
parent6da063a1c9cdade5cd64675ecfe2cdfb5e8b17f7 (diff)
downloadparamiko-1919964110333aa91df3e33424b763384bea127f.tar.gz
Never actually handled optional-ness of Invoke import
Was just silently failing, wahoops
Diffstat (limited to 'tests/test_config.py')
-rw-r--r--tests/test_config.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index 16f09c48..7c86667a 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -702,6 +702,15 @@ def _expect(success_on):
class TestMatchExec(object):
+ @patch("paramiko.config.invoke", new=None)
+ @patch("paramiko.config.invoke_import_error", new=ImportError("meh"))
+ def test_raises_invoke_ImportErrors_at_runtime(self):
+ # Not an ideal test, but I don't know of a non-bad way to fake out
+ # module-time ImportErrors. So we mock the symptoms. Meh!
+ with raises(ImportError) as info:
+ load_config("match-exec").lookup("oh-noes")
+ assert str(info.value) == "meh"
+
@patch("paramiko.config.invoke.run")
@mark.parametrize(
"cmd,user",