twisted.conch.test.test_cftp.SFTPTestProcess(protocol.ProcessProtocol)
class documentationtwisted.conch.test.test_cftp
(View In Hierarchy)
Protocol for testing cftp. Provides an interface between Python (where all the tests are) and the cftp client process (which does the work that is being tested).
Method | __init__ | |
Method | clearBuffer | Clear any buffered data received from stdout. Should be private. |
Method | outReceived | Called by Twisted when the cftp client prints data to stdout. |
Method | errReceived | Called by Twisted when the cftp client prints data to stderr. |
Method | getBuffer | Return the contents of the buffer of data received from stdout. |
Method | runCommand | Issue the given command via the cftp client. Return a
Deferred that fires when the server returns a result. Note
that the Deferred will callback even if the server returns
some kind of error. |
Method | runScript | Run each command in sequence and return a Deferred that fires when all commands are completed. |
Method | killProcess | Kill the process if it is still running. |
Method | processEnded | Called by Twisted when the cftp client process ends. |
Method | _checkForCommand | Undocumented |
Inherited from ProcessProtocol:
Method | childDataReceived | Called when data arrives from the child process. |
Method | childConnectionLost | Called when a file descriptor associated with the child process is closed. |
Method | inConnectionLost | This will be called when stdin is closed. |
Method | outConnectionLost | This will be called when stdout is closed. |
Method | errConnectionLost | This will be called when stderr is closed. |
Method | processExited | This will be called when the subprocess exits. |
Inherited from BaseProtocol (via ProcessProtocol):
Method | makeConnection | Make a connection to a transport and a server. |
Method | connectionMade | Called when a connection is made. |
Parameters | onOutReceived | A Deferred
to be fired as soon as data is received from stdout. |
Issue the given command via the cftp client. Return a
Deferred
that fires when the server returns a result. Note
that the Deferred
will callback even if the server returns
some kind of error.
Parameters | command | A string containing an sftp command. |
Returns | A Deferred that fires when the sftp server returns a result.
The payload is the server's response string. |
Run each command in sequence and return a Deferred that fires when all commands are completed.
Parameters | commands | A list of strings containing sftp commands. |
Returns | A Deferred that fires when all commands are completed. The
payload is a list of response strings from the server, in the same order as
the commands. |
Kill the process if it is still running.
If the process is still running, sends a KILL signal to the transport
and returns a Deferred
which fires when processEnded
is called.
Returns | a Deferred . |