diff options
author | Robey Pointer <robey@lag.net> | 2006-05-07 16:01:53 -0700 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2006-05-07 16:01:53 -0700 |
commit | de1e072c739b7f6a97fcdb5438920acfbb657576 (patch) | |
tree | 7f1b8cacac515c7559060c8665a382cab5af5759 /tests | |
parent | 581103665b82f50d71aacb12881f9fd0b3fcca88 (diff) |
[project @ robey@lag.net-20060507230153-dba6b2d664b5ef3f]
channel operations raise an exception on error now instead of returning a bool
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_transport.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/test_transport.py b/tests/test_transport.py index b2e8b6f6..f73f0f7f 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -353,10 +353,14 @@ class TransportTest (unittest.TestCase): chan = self.tc.open_session() schan = self.ts.accept(1.0) - self.assert_(not chan.exec_command('no')) + try: + chan.exec_command('no') + self.assert_(False) + except SSHException, x: + pass chan = self.tc.open_session() - self.assert_(chan.exec_command('yes')) + chan.exec_command('yes') schan = self.ts.accept(1.0) schan.send('Hello there.\n') schan.send_stderr('This is on stderr.\n') @@ -371,7 +375,7 @@ class TransportTest (unittest.TestCase): # now try it with combined stdout/stderr chan = self.tc.open_session() - self.assert_(chan.exec_command('yes')) + chan.exec_command('yes') schan = self.ts.accept(1.0) schan.send('Hello there.\n') schan.send_stderr('This is on stderr.\n') @@ -402,7 +406,7 @@ class TransportTest (unittest.TestCase): self.assert_(self.ts.is_active()) chan = self.tc.open_session() - self.assert_(chan.invoke_shell()) + chan.invoke_shell() schan = self.ts.accept(1.0) chan.send('communist j. cat\n') f = schan.makefile() @@ -454,7 +458,7 @@ class TransportTest (unittest.TestCase): chan = self.tc.open_session() schan = self.ts.accept(1.0) - self.assert_(chan.exec_command('yes')) + chan.exec_command('yes') schan.send('Hello there.\n') # trigger an EOF schan.shutdown_read() @@ -487,7 +491,7 @@ class TransportTest (unittest.TestCase): self.assert_(self.ts.is_active()) chan = self.tc.open_session() - self.assert_(chan.invoke_shell()) + chan.invoke_shell() schan = self.ts.accept(1.0) # nothing should be ready @@ -550,7 +554,7 @@ class TransportTest (unittest.TestCase): self.tc.packetizer.REKEY_BYTES = 16384 chan = self.tc.open_session() - self.assert_(chan.exec_command('yes')) + chan.exec_command('yes') schan = self.ts.accept(1.0) self.assertEquals(self.tc.H, self.tc.session_id) @@ -586,7 +590,7 @@ class TransportTest (unittest.TestCase): self.assert_(self.ts.is_active()) chan = self.tc.open_session() - self.assert_(chan.exec_command('yes')) + chan.exec_command('yes') schan = self.ts.accept(1.0) bytes = self.tc.packetizer._Packetizer__sent_bytes |