plainbox.impl.transport
– shared code for test data transports¶
Warning
THIS MODULE DOES NOT HAVE STABLE PUBLIC API
-
class
plainbox.impl.transport.
TransportBase
(where, option_string)[source]¶ Bases:
plainbox.abc.ISessionStateTransport
Base class for transports that send test data somewhere.
They handle just the transmission portion of data sending; exporters are expected to produce data in the proper format (e.g. json, xml).
Each transport can have specific parameters that are required for the other end to properly process received information (like system identification, authorization data and so on), and that don’t semantically belong in the test data as produced by the exporter. Additionally each transport needs to be told where to send test data. This is transport-dependent; things like a HTTP endpoint, IP address, port are good examples.
-
send
(data, config=None, session_state=None)¶ Send data somewhere.
Parameters: - data – a stream-like object of data to send (read only)
- config – a PlainBoxConfig object (optional)
- session_state – the session for which this transport is associated with the data being sent (optional)
Raises: - ValueError – if any of the arguments are somehow invalid
- TransportError – if any transport-specific problem arises
Returns: a dictionary with additional items, see notes below
Note
The return value is especially vague specifically to allow various transports to express whatever they may need to express for a particular vertical use case yet still to allow most of the code to just work with all transports.
It is expected that certain keys in the returned dictionary will gain special semantics that can be further standardized. As of this writing there are no standard keys.
-