summaryrefslogtreecommitdiffhomepage
path: root/tests/test_util.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2019-08-27 14:20:27 -0400
committerJeff Forcier <jeff@bitprophet.org>2019-09-27 14:17:36 -0500
commit4c4de253e3909adb99505b6723c58c23d64f7988 (patch)
treef14352dbfc135fd781360f0a909342079a82f9c1 /tests/test_util.py
parentb1bbacdcc4f0be50b8fe584f329d344fb13544bd (diff)
Implement ssh_config hostname canonicalization (WIP)
- Refactor DNS lookup related junk previously only relevant to %h - Refactor guts of lookup() so it can be done >1 time - Changelog/tests/implementation for canonicalization itself Closes #897
Diffstat (limited to 'tests/test_util.py')
-rw-r--r--tests/test_util.py73
1 files changed, 38 insertions, 35 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 7849fec3..84a48bd3 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -43,44 +43,47 @@ BGQ3GQ/Fc7SX6gkpXkwcZryoi4kNFhHu5LvHcZPdxXV1D+uTMfGS1eyd2Yz/DoNWXNAl8TI0cAsW\
class UtilTest(unittest.TestCase):
- def test_import(self):
+ def test_imports(self):
"""
verify that all the classes can be imported from paramiko.
"""
- symbols = paramiko.__all__
- self.assertTrue("Agent" in symbols)
- self.assertTrue("AgentKey" in symbols)
- self.assertTrue("AuthenticationException" in symbols)
- self.assertTrue("AutoAddPolicy" in symbols)
- self.assertTrue("BadAuthenticationType" in symbols)
- self.assertTrue("BufferedFile" in symbols)
- self.assertTrue("Channel" in symbols)
- self.assertTrue("ChannelException" in symbols)
- self.assertTrue("DSSKey" in symbols)
- self.assertTrue("HostKeys" in symbols)
- self.assertTrue("Message" in symbols)
- self.assertTrue("MissingHostKeyPolicy" in symbols)
- self.assertTrue("PasswordRequiredException" in symbols)
- self.assertTrue("RSAKey" in symbols)
- self.assertTrue("RejectPolicy" in symbols)
- self.assertTrue("SFTP" in symbols)
- self.assertTrue("SFTPAttributes" in symbols)
- self.assertTrue("SFTPClient" in symbols)
- self.assertTrue("SFTPError" in symbols)
- self.assertTrue("SFTPFile" in symbols)
- self.assertTrue("SFTPHandle" in symbols)
- self.assertTrue("SFTPServer" in symbols)
- self.assertTrue("SFTPServerInterface" in symbols)
- self.assertTrue("SSHClient" in symbols)
- self.assertTrue("SSHConfig" in symbols)
- self.assertTrue("SSHConfigDict" in symbols)
- self.assertTrue("SSHException" in symbols)
- self.assertTrue("SecurityOptions" in symbols)
- self.assertTrue("ServerInterface" in symbols)
- self.assertTrue("SubsystemHandler" in symbols)
- self.assertTrue("Transport" in symbols)
- self.assertTrue("WarningPolicy" in symbols)
- self.assertTrue("util" in symbols)
+ for name in (
+ "Agent",
+ "AgentKey",
+ "AuthenticationException",
+ "AutoAddPolicy",
+ "BadAuthenticationType",
+ "BufferedFile",
+ "Channel",
+ "ChannelException",
+ "CouldNotCanonicalize",
+ "DSSKey",
+ "HostKeys",
+ "Message",
+ "MissingHostKeyPolicy",
+ "PasswordRequiredException",
+ "RSAKey",
+ "RejectPolicy",
+ "SFTP",
+ "SFTPAttributes",
+ "SFTPClient",
+ "SFTPError",
+ "SFTPFile",
+ "SFTPHandle",
+ "SFTPServer",
+ "SFTPServerInterface",
+ "SSHClient",
+ "SSHConfig",
+ "SSHConfigDict",
+ "SSHException",
+ "SecurityOptions",
+ "ServerInterface",
+ "SubsystemHandler",
+ "Transport",
+ "WarningPolicy",
+ "util",
+ ):
+ assert name in paramiko.__all__
def test_generate_key_bytes(self):
x = paramiko.util.generate_key_bytes(