twisted.conch.test.test_session.StubSessionForStubAvatar(object) class documentationtwisted.conch.test.test_session
(View In Hierarchy)
Implements interfaces: twisted.conch.interfaces.ISession
A stub ISession implementation for our StubAvatar. The instance variables generally keep track of method invocations so that we can test that the methods were called.
| Instance Variable | avatar | the StubAvatarwe are adapting. | 
| Instance Variable | ptyRequest | if present, the terminal, window size, and modes passed to the getPty method. | 
| Instance Variable | windowChange | if present, the window size passed to the windowChangned method. | 
| Instance Variable | shellProtocol | if present, the SSHSessionProcessProtocolpassed to the openShell method. | 
| Instance Variable | shellTransport | if present, the EchoTransportconnected to shellProtocol. | 
| Instance Variable | execProtocol | if present, the SSHSessionProcessProtocolpassed to the execCommand method. | 
| Instance Variable | execTransport | if present, the EchoTransportconnected to execProtocol. | 
| Instance Variable | execCommandLine | if present, the command line passed to the execCommand method. | 
| Instance Variable | gotEOF | if present, an EOF message was received. | 
| Instance Variable | gotClosed | if present, a closed message was received. | 
| Method | __init__ | Store the avatar we're adapting. | 
| Method | getPty | If the terminal is 'bad', fail. Otherwise, store the information in the ptyRequest variable. | 
| Method | windowChanged | If all the window sizes are 0, fail. Otherwise, store the size in the windowChange variable. | 
| Method | openShell | If we have gotten a shell request before, fail. Otherwise, store the process protocol in the shellProtocol variable, connect it to the EchoTransport and store that as shellTransport. | 
| Method | execCommand | If the command is 'true', store the command, the process protocol, and the transport we connect to the process protocol. Otherwise, just store the command and raise an error. | 
| Method | eofReceived | Note that EOF has been received. | 
| Method | closed | Note that close has been received. | 
If the terminal is 'bad', fail. Otherwise, store the information in the ptyRequest variable.
If all the window sizes are 0, fail. Otherwise, store the size in the windowChange variable.
If we have gotten a shell request before, fail. Otherwise, store the process protocol in the shellProtocol variable, connect it to the EchoTransport and store that as shellTransport.