diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-10-10 15:57:20 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-10-10 15:57:20 -0700 |
commit | 80f4eb90de277aa5081d977b6403135263c7416b (patch) | |
tree | 97e52cde3381bbcb19dd3079b3d12709a91fd05a /tests | |
parent | bac31540cf83b718324928e69e1bf43ff17cb590 (diff) |
Split out env-set failure test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_client.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test_client.py b/tests/test_client.py index 45be5926..fb8be6eb 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -556,10 +556,7 @@ class SSHClientTest (unittest.TestCase): def test_host_key_negotiation_4(self): self._client_host_key_good(paramiko.RSAKey, 'test_rsa.key') - def test_update_environment(self): - """ - Verify that environment variables can be set by the client. - """ + def _setup_for_env(self): threading.Thread(target=self._run).start() self.tc = paramiko.SSHClient() @@ -571,6 +568,11 @@ class SSHClientTest (unittest.TestCase): self.assertTrue(self.event.isSet()) self.assertTrue(self.ts.is_active()) + def test_update_environment(self): + """ + Verify that environment variables can be set by the client. + """ + self._setup_for_env() target_env = {b'A': b'B', b'C': b'd'} self.tc.exec_command('yes', environment=target_env) @@ -578,6 +580,8 @@ class SSHClientTest (unittest.TestCase): self.assertEqual(target_env, getattr(schan, 'env', {})) schan.close() + def test_env_update_failures(self): + self._setup_for_env() with self.assertRaises(SSHException) as manager: # Verify that a rejection by the server can be detected self.tc.exec_command('yes', environment={b'INVALID_ENV': b''}) |