summaryrefslogtreecommitdiff
path: root/tests/test_pkey.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2022-05-20 15:10:35 -0400
committerJeff Forcier <jeff@bitprophet.org>2022-05-20 15:10:35 -0400
commit2b32b402c5f574699fe43b4d6b6f2b645e26849e (patch)
treee02305b079b22c334ec2624063f93be099b7857e /tests/test_pkey.py
parent50d33223f9ec9e308a3fda519b36f78be859c4bc (diff)
parentddba5762c9c0878b83fb6a7344ad24ba74af5720 (diff)
downloadparamiko-2b32b402c5f574699fe43b4d6b6f2b645e26849e.tar.gz
Merge branch '2.10' into 2.11
Diffstat (limited to 'tests/test_pkey.py')
-rw-r--r--tests/test_pkey.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_pkey.py b/tests/test_pkey.py
index 738e8cf0..a2376fa9 100644
--- a/tests/test_pkey.py
+++ b/tests/test_pkey.py
@@ -186,6 +186,11 @@ class KeyTest(unittest.TestCase):
with pytest.raises(SSHException, match=str(exception)):
RSAKey.from_private_key_file(_support("test_rsa.key"))
+ def test_loading_empty_keys_errors_usefully(self):
+ # #1599 - raise SSHException instead of IndexError
+ with pytest.raises(SSHException, match="no lines"):
+ RSAKey.from_private_key_file(_support("blank_rsa.key"))
+
def test_load_rsa_password(self):
key = RSAKey.from_private_key_file(
_support("test_rsa_password.key"), "television"