class LocalWorkerAMP(AMP): (source)
Constructor: LocalWorkerAMP(boxReceiver, locator)
Local implementation of the manager commands.
Method | __init__ |
Undocumented |
Method | add |
Add an error to the reporter. |
Method | add |
Add an expected failure to the reporter. |
Method | add |
Add a failure to the reporter. |
Method | add |
Add a skip to the reporter. |
Method | add |
Add a success to the reporter. |
Method | add |
Add an unexpected success to the reporter. |
Async Method | run |
Run a test. |
Method | set |
Set the stream used to log output from tests. |
Method | stream |
Undocumented |
Method | stream |
Undocumented |
Method | test |
Print test output from the worker. |
Method | _build |
Helper to build a Failure with some traceback. |
Instance Variable | _result |
Undocumented |
Instance Variable | _streams |
Undocumented |
Instance Variable | _test |
Undocumented |
Instance Variable | _test |
Undocumented |
Inherited from AMP
:
Method | __repr__ |
A verbose string representation which gives us information about this AMP connection. |
Method | connection |
Emit a helpful log message when the connection is lost. |
Method | locate |
Unify the implementations of CommandLocator and SimpleStringLocator to perform both kinds of dispatch, preferring CommandLocator . |
Method | make |
Emit a helpful log message when the connection is made. |
Instance Variable | transport |
Undocumented |
Instance Variable | _amp |
Undocumented |
Instance Variable | _transport |
Undocumented |
Instance Variable | _transport |
Undocumented |
Inherited from BinaryBoxProtocol
(via AMP
):
Method | data |
Either parse incoming data as AmpBox es or relay it to our nested protocol. |
Method | length |
The key length limit was exceeded. Disconnect the transport and make sure a meaningful exception is reported. |
Method | proto |
String received in the 'init' state. |
Method | proto |
String received in the 'key' state. If the key is empty, a complete box has been received. |
Method | proto |
String received in the 'value' state. |
Method | send |
Send a amp.Box to my peer. |
Method | unhandled |
The buck stops here. This error was completely unhandled, time to terminate the connection. |
Class Variable | no |
Undocumented |
Instance Variable | box |
an IBoxReceiver provider, whose IBoxReceiver.ampBoxReceived method will be invoked for each AmpBox that is received. |
Instance Variable | host |
Undocumented |
Instance Variable | inner |
Undocumented |
Instance Variable | inner |
Undocumented |
Instance Variable | MAX |
Undocumented |
Instance Variable | recvd |
Undocumented |
Property | peer |
Undocumented |
Method | _default |
The default TLS responder doesn't specify any certificate or anything. |
Method | _lock |
Lock this binary protocol so that no further boxes may be sent. This is used when sending a request to switch underlying protocols. You probably want to subclass ProtocolSwitchCommand rather than calling this directly. |
Method | _prepare |
Used by StartTLSCommand to put us into the state where we don't actually send things that get sent, instead we buffer them. see _sendBoxCommand . |
Method | _start |
Used by TLSBox to initiate the SSL handshake. |
Method | _switch |
Switch this BinaryBoxProtocol's transport to a new protocol. You need to do this 'simultaneously' on both ends of a connection; the easiest way to do this is to use a subclass of ProtocolSwitchCommand. |
Method | _unlock |
Unlock this locked binary protocol so that further boxes may be sent again. This is used after an attempt to switch protocols has failed for some reason. |
Constant | _MAX |
Undocumented |
Constant | _MAX |
Undocumented |
Instance Variable | _current |
Undocumented |
Instance Variable | _current |
Undocumented |
Instance Variable | _just |
Undocumented |
Instance Variable | _key |
A flag which is only true when the connection is being closed because a key length prefix which was longer than allowed by the protocol was received. |
Instance Variable | _locked |
Undocumented |
Instance Variable | _starting |
Undocumented |
Inherited from StatefulStringProtocol
(via AMP
, BinaryBoxProtocol
):
Method | string |
Choose a protocol phase function and call it. |
Instance Variable | state |
Current state of the protocol. Defaults to 'init'. |
Inherited from Int16StringReceiver
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
):
Instance Variable | prefix |
Undocumented |
Instance Variable | struct |
Undocumented |
Inherited from IntNStringReceiver
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
, Int16StringReceiver
):
Method | send |
Send a prefixed string to the other end of the connection. |
Instance Variable | _compatibility |
the offset within _unprocessed to the next message to be parsed. (used to generate the recvd attribute) |
Instance Variable | _unprocessed |
bytes received, but not yet broken up into messages / sent to stringReceived. _compatibilityOffset must be updated when this value is updated so that the recvd attribute can be generated correctly. |
Inherited from Protocol
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
, Int16StringReceiver
, IntNStringReceiver
):
Method | log |
Return a prefix matching the class name, to identify log messages related to this protocol instance. |
Class Variable | factory |
Undocumented |
Inherited from BaseProtocol
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
, Int16StringReceiver
, IntNStringReceiver
, Protocol
):
Method | connection |
Called when a connection is made. |
Instance Variable | connected |
Undocumented |
Inherited from _PauseableMixin
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
, Int16StringReceiver
, IntNStringReceiver
, Protocol
, BaseProtocol
):
Method | pause |
Undocumented |
Method | resume |
Undocumented |
Method | stop |
Undocumented |
Instance Variable | paused |
Undocumented |
Inherited from _DescriptorExchanger
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
, Int16StringReceiver
, IntNStringReceiver
, Protocol
, BaseProtocol
, _PauseableMixin
):
Method | file |
Collect received file descriptors to be claimed later by Descriptor . |
Method | _send |
Assign and return the next ordinal to the given descriptor after sending the descriptor over this protocol's transport. |
Instance Variable | _descriptors |
Temporary storage for all file descriptors received. Values in this dictionary are the file descriptors (as integers). Keys in this dictionary are ordinals giving the order in which each descriptor was received... |
Instance Variable | _get |
Undocumented |
Instance Variable | _receiving |
A no-argument callable which returns the ordinals, starting from 0. This is used to construct values for fileDescriptorReceived. |
Instance Variable | _sending |
A no-argument callable which returns the ordinals, starting from 0. This is used to construct values for _sendFileDescriptor. |
Inherited from BoxDispatcher
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
, Int16StringReceiver
, IntNStringReceiver
, Protocol
, BaseProtocol
, _PauseableMixin
, _DescriptorExchanger
):
Method | amp |
An AmpBox was received, representing a command, or an answer to a previously issued command (either successful or erroneous). Respond to it according to its contents. |
Method | call |
This is the primary high-level API for sending messages via AMP. Invoke it with a command and appropriate arguments to send a message to this connection's peer. |
Method | call |
This is a low-level API, designed only for optimizing simple messages for which the overhead of parsing is too great. |
Method | dispatch |
A box with a _command key was received. |
Method | fail |
Call the errback on all outstanding requests awaiting responses. |
Method | start |
The given boxSender is going to start calling boxReceived on this BoxDispatcher . |
Method | stop |
No further boxes will be received here. Terminate all currently outstanding command deferreds with the given reason. |
Instance Variable | box |
an object which can send boxes, via the _sendBoxCommand method, such as an AMP instance. |
Instance Variable | locator |
an object with a CommandLocator.locateResponder method that locates a responder function that takes a Box and returns a result (either a Box or a Deferred which fires one). |
Method | _answer |
An AMP box was received that answered a command previously sent with callRemote . |
Method | _command |
No summary |
Method | _error |
An AMP box was received that answered a command previously sent with callRemote , with an error. |
Method | _next |
Generate protocol-local serial numbers for _ask keys. |
Method | _safe |
Emit a box, ignoring ProtocolSwitched and ConnectionLost errors which cannot be usefully handled. |
Method | _send |
Send a command across the wire with the given amp.Box. |
Class Variable | _counter |
Undocumented |
Instance Variable | _fail |
Undocumented |
Instance Variable | _outstanding |
a dictionary mapping request IDs to Deferred s which were returned for those requests. |
Inherited from CommandLocator
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
, Int16StringReceiver
, IntNStringReceiver
, Protocol
, BaseProtocol
, _PauseableMixin
, _DescriptorExchanger
, BoxDispatcher
):
Method | lookup |
Deprecated synonym for CommandLocator.locateResponder |
Method | _wrap |
Wrap aCallable with its command's argument de-serialization and result serialization logic. |
Inherited from SimpleStringLocator
(via AMP
, BinaryBoxProtocol
, StatefulStringProtocol
, Int16StringReceiver
, IntNStringReceiver
, Protocol
, BaseProtocol
, _PauseableMixin
, _DescriptorExchanger
, BoxDispatcher
, CommandLocator
):
Class Variable | base |
Undocumented |
def addError(self, testName:
str
, errorClass: str
, errorStreamId: int
, framesStreamId: int
) -> Dict[ str, bool]
:
(source)
¶
Add an error to the reporter.
Parameters | |
teststr | Undocumented |
errorstr | Undocumented |
errorint | The identifier of a stream over which the text of this error was previously completely sent to the peer. |
framesint | The identifier of a stream over which the lines of the traceback for this error were previously completely sent to the peer. |
error | A message describing the error. |
Returns | |
Dict[ | Undocumented |
def addFailure(self, testName:
str
, failStreamId: int
, failClass: str
, framesStreamId: int
) -> Dict[ str, bool]
:
(source)
¶
Add a failure to the reporter.
Parameters | |
teststr | Undocumented |
failint | The identifier of a stream over which the text of this failure was previously completely sent to the peer. |
failstr | Undocumented |
framesint | The identifier of a stream over which the lines of the traceback for this error were previously completely sent to the peer. |
Returns | |
Dict[ | Undocumented |
def addUnexpectedSuccess(self, testName, todo): (source) ¶
Add an unexpected success to the reporter.
WorkerException
, errorClass: str
, frames: List[ str]
) -> Failure
:
(source)
¶
Helper to build a Failure with some traceback.
Parameters | |
error:WorkerException | An Exception instance. |
errorstr | The class name of the error class. |
frames:List[ | A flat list of strings representing the information need to approximatively rebuild Failure frames. |
Returns | |
Failure | A Failure instance with enough information about a test error. |