def test_adds_missing_host_key(self, mock_LOG): client = ssh.connect("123.456.789.0", options={'StrictHostKeyChecking': 'no'}) client._connect() pkey = ssh.make_pkey(self.rsakey) client._policy.missing_host_key(client, "123.456.789.0", pkey) expected = {'123.456.789.0': {'ssh-rsa': pkey}} self.assertEqual(expected, client._host_keys)
def test_adds_missing_host_key(self, mock_LOG): client = ssh.connect( "123.456.789.0", options={'StrictHostKeyChecking': 'no'}) client._connect() pkey = ssh.make_pkey(self.rsakey) client._policy.missing_host_key( client, "123.456.789.0", pkey) expected = {'123.456.789.0': { 'ssh-rsa': pkey}} self.assertEqual(expected, client._host_keys)
def test_valid_dsa_logs_key_class(self, mock_LOG): ssh.make_pkey(self.dsakey) mock_LOG.info.assert_called_with('Valid SSH Key provided (%s)', 'DSSKey')
def test_valid_ds_returns_pkey_obj(self): self.assertIsInstance(ssh.make_pkey(self.dsakey), paramiko.PKey)
def test_valid_dsa_logs_key_class(self, mock_LOG): ssh.make_pkey(self.dsakey) mock_LOG.info.assert_called_with( 'Valid SSH Key provided (%s)', 'DSSKey')