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.
def __init__(self, onOutReceived):
ParametersonOutReceivedA Deferred to be fired as soon as data is received from stdout.
def clearBuffer(self):

Clear any buffered data received from stdout. Should be private.

def outReceived(self, data):

Called by Twisted when the cftp client prints data to stdout.

def _checkForCommand(self):
Undocumented
def errReceived(self, data):

Called by Twisted when the cftp client prints data to stderr.

def getBuffer(self):

Return the contents of the buffer of data received from stdout.

def runCommand(self, command):

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.

ParameterscommandA string containing an sftp command.
ReturnsA Deferred that fires when the sftp server returns a result. The payload is the server's response string.
def runScript(self, commands):

Run each command in sequence and return a Deferred that fires when all commands are completed.

ParameterscommandsA list of strings containing sftp commands.
ReturnsA 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.
def killProcess(self):

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.

Returnsa Deferred.
def processEnded(self, reason):

Called by Twisted when the cftp client process ends.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.