testplan.testing.multitest.driver.http package

Submodules

testplan.testing.multitest.driver.http.client module

HTTPClient Driver.

class testplan.testing.multitest.driver.http.client.HTTPClient(name: str, host: str | ContextValue, port: int | ContextValue | None = None, protocol: str = 'http', timeout: int = 5, interval: float = 0.01, **options: Any)[source]

Bases: Driver

Driver for a client that can connect to a server and send/receive messages using HTTP protocol.

{emphasized_members_docs}

Parameters:
  • name (str) – Name of HTTPClient.

  • host (str or ContextValue) – Hostname to connect to.

  • port (int or ContextValue) – Port to connect to. If None URL won’t specify a port.

  • protocol (str) – Use HTTP or HTTPS protocol.

  • timeout (int) – Number of seconds to wait for a request.

  • interval (int) – Number of seconds to sleep whilst trying to receive a message.

Also inherits all Driver options.

CONFIG

alias of HTTPClientConfig

EXTRACTORS: List[BaseConnectionExtractor] = [<testplan.testing.multitest.driver.connection.connection_extractor.ConnectionExtractor object>]
STATUS

alias of ResourceStatus

abort() None

Default abort policy. First abort all dependencies and then itself.

abort_dependencies() Generator[Entity, None, None]

Returns an empty generator.

property aborted: bool

Returns if entity was aborted.

aborting() None[source]

Abort logic that stops the client.

property active: bool

Entity not aborting/aborted.

property async_start: bool

Overrides the default async_start value in config.

property auto_start: bool

If False, the resource will not be automatically started by its parent (generally, a Environment object) while the parent is starting.

property cfg: Config

Configuration object.

property connection_identifier: int | Literal[''] | None
property context: Environment | None

Key/value pair information of a Resource.

context_input(exclude: list | None = None) Dict[str, Any]

All attr of self in a dict for context resolution

define_runpath() None

Define runpath directory based on parent object and configuration.

delete(api: str, **kwargs: Any) None[source]

Send DELETE request.

Parameters:
  • api (str) – API to send request to.

  • kwargs (Depends on the argument.) – Optional arguments for the request, look at the requests modules docs for these arguments.

property errpath: str | None

Path for stderr file regexp matching.

extract_values() bool | FailedAction

Extract matching values from input regex configuration options.

extracts: Dict[str, str]
failover() Resource | None

API to create the failover resource, to be implemented in derived class

fetch_error_log() List[str]

Fetch error message from the log files of driver, at first we can try self.errpath, if it does not exist, try self.logpath. Typically, several lines from the tail of file will be selected.

Returns:

text from log file

classmethod filter_locals(local_vars: Dict[str, Any]) Dict[str, Any]

Filter out init params of None value, they will take default value defined in its ConfigOption object; also filter out special vars that are not init params from local_vars.

Parameters:

local_vars

flush() None[source]

Drop any currently incoming messages and flush the received messages queue.

force_started() None

Change the status to STARTED (e.g. exception raised).

force_stop() None

Change the status to STOPPED (e.g. exception raised).

get(api: str, params: Dict[str, Any] | None = None, **kwargs: Any) None[source]

Send GET request.

Parameters:
  • api (str) – API to send request to.

  • params (dict) – Parameters to append to HTTP request after ?.

  • kwargs (Depends on the argument.) – Optional arguments for the request, look at the requests modules docs for these arguments.

get_connections() List[BaseConnectionInfo]
head(api: str, **kwargs: Any) None[source]

Send HEAD request.ZMQClient

Parameters:
  • api (str) – API to send request to.

  • kwargs (Depends on the argument.) – Optional arguments for the request, look at the requests modules docs for these arguments.

property host: str | None

Target host name.

install_files() None

Installs the files specified in the install_files parameter at the install target.

property is_alive: bool

Called to periodically poll the resource health. Default implementation assumes the resource is always healthy.

property logger: TestplanLogger

logger object

property logpath: str | None

Path for log regexp matching.

make_runpath_dirs() None

Creates runpath related directories.

property name: str

Driver name.

options(api: str, **kwargs: Any) None[source]

Send OPTIONS request.

Parameters:
  • api (str) – API to send request to.

  • kwargs (Depends on the argument.) – Optional arguments for the request, look at the requests modules docs for these arguments.

property outpath: str | None

Path for stdout file regexp matching.

property parent: Entity | None

Returns parent Entity.

patch(api: str, data: Any | None = None, **kwargs: Any) None[source]

Send PATCH request.

Parameters:
  • api (str) – API to send request to.

  • data (dict) – Dictionary to send in the body of the request.

  • kwargs (Depends on the argument.) – Optional arguments for the request, look at the requests modules docs for these arguments.

pause() None

Pauses entity execution.

pausing() None

Pause the resource.

pending_work() bool

Resource has pending work.

property port: int | Literal[''] | None

Client port number assigned.

post(api: str, data: Any | None = None, json: Any | None = None, **kwargs: Any) None[source]

Send POST request.

Parameters:
  • api (str) – API to send request to.

  • data (dict) – Dictionary to send in the body of the request.

  • json (dict) – JSON data to send in the body of the request.

  • kwargs (Depends on the argument.) – Optional arguments for the request, look at the requests modules docs for these arguments.

post_start() None

Steps to be executed right after resource is started.

post_stop() None

Steps to be executed right after resource is stopped.

pre_start() None

Steps to be executed right before resource starts.

pre_stop() None

Steps to be executed right before resource stops.

put(api: str, data: Any | None = None, **kwargs: Any) None[source]

Send PUT request.

Parameters:
  • api (str) – API to send request to.

  • data (dict) – Dictionary to send in the body of the request.

  • kwargs (Depends on the argument.) – Optional arguments for the request, look at the requests modules docs for these arguments.

receive(timeout: int | None = None) Response | None[source]

Wait to receive a response.

Parameters:

timeout (int) – Number of seconds to wait for a response, overrides timeout from init.

Returns:

A request response or None

Return type:

requests.models.Response or NoneType

register_failover(klass: Type[Entity], params: dict) None

Register a failover class to instantiate if resource start fails.

Parameters:
  • klass – failover class

  • params – parameters for failover class __init__ method

property report: ReportLink

A handle to access the report via recursive parent

restart() None

Stop and start the resource.

resume() None

Resumes entity execution.

resuming() None

Resume the resource.

property runpath: str

Path to be used for temp/output files by entity.

property scratch: str

Path to be used for temp files by entity.

send(method: str, api: str, **kwargs: Any) None[source]

Send a non blocking HTTP request.

Parameters:
  • method (str) – HTTP method to be used in request (e.g. GET, POST etc.).

  • api (str) – API to send request to.

  • kwargs (Depends on the argument.) – Optional arguments for the request, look at the requests modules docs for these arguments.

start() None

Triggers the start logic of a Resource by executing :py:meth: Resource.starting <testplan.common.entity.base.Resource.starting> method.

property start_timeout: float
started_check() bool | FailedAction

Predicate indicating whether driver has fully started.

Default implementation tests whether certain pattern exists in driver loggings, always returns True if no pattern is required.

property started_check_interval: float | Tuple[float, float]

Driver started check interval. In practice this value is lower-bounded by 0.1 seconds.

starting() None[source]

Start the HTTPClient.

property status: EntityStatus

Status object.

stop() None

Triggers the stop logic of a Resource by executing :py:meth: Resource.stopping <testplan.common.entity.base.Resource.stopping> method.

property stop_timeout: float
stopped_check() bool | FailedAction

Predicate indicating whether driver has fully stopped.

Default implementation immediately returns True.

property stopped_check_interval: float | Tuple[float, float]

Driver stopped check interval.

stopped_check_with_watch(watch: Any) bool | FailedAction
stopping() None[source]

Stop the HTTPClient.

property timer: Timer
uid() str

Driver uid.

wait(target_status: str | None, timeout: int | None = None) None

Wait until objects status becomes target status.

Parameters:
  • target_status (str) – expected status

  • timeout (int or NoneType) – timeout in seconds

class testplan.testing.multitest.driver.http.client.HTTPClientConfig(**options: Any)[source]

Bases: DriverConfig

Configuration object for HTTPClient driver.

classmethod build_schema() Schema

Build a validation schema using the config options defined in this class and its parent classes.

denormalize() Config

Create new config object that inherits all explicit attributes from its parents as well.

get_local(name: str, default: Any = None) Any

Returns a local config setting (not from container)

classmethod get_options() Dict[Any, Any][source]

Schema for options validation and assignment of default values.

ignore_extra_keys = False
property parent: Config | None

Returns the parent configuration.

set_local(name: str, value: Any) None

set without any check

testplan.testing.multitest.driver.http.server module

HTTPServer Driver.

class testplan.testing.multitest.driver.http.server.HTTPRequestHandler(request, client_address, server)[source]

Bases: BaseHTTPRequestHandler

Responds to any HTTP request with response in queue. If empty send an error message in response.

MessageClass

alias of HTTPMessage

address_string()

Return the client address.

date_time_string(timestamp=None)

Return the current date and time formatted for a message header.

default_request_version = 'HTTP/0.9'
disable_nagle_algorithm = False
do_DELETE() None[source]

Handles a DELETE request.

do_GET() None[source]

Handles a GET request.

do_HEAD() None[source]

Handles a HEAD request.

do_OPTIONS() None[source]

Handles a OPTIONS request.

do_PATCH() None[source]

Handles a PATCH request.

do_POST() None[source]

Handles a POST request.

do_PUT() None[source]

Handles a PUT request.

end_headers()

Send the blank line ending the MIME headers.

error_content_type = 'text/html;charset=utf-8'
error_message_format = '<!DOCTYPE HTML>\n<html lang="en">\n    <head>\n        <meta charset="utf-8">\n        <style type="text/css">\n            :root {\n                color-scheme: light dark;\n            }\n        </style>\n        <title>Error response</title>\n    </head>\n    <body>\n        <h1>Error response</h1>\n        <p>Error code: %(code)d</p>\n        <p>Message: %(message)s.</p>\n        <p>Error code explanation: %(code)s - %(explain)s.</p>\n    </body>\n</html>\n'
finish()
flush_headers()
get_response(request: ReceivedRequest) HTTPResponse[source]

Parse the request and return the response.

Parameters:

request – The request path.

Returns:

Http response.

handle()

Handle multiple requests if necessary.

handle_expect_100()

Decide what to do with an “Expect: 100-continue” header.

If the client is expecting a 100 Continue response, we must respond with either a 100 Continue or a final response before waiting for the request body. The default is to always respond with a 100 Continue. You can behave differently (for example, reject unauthorized requests) by overriding this method.

This method should either return True (possibly after sending a 100 Continue response) or send an error response and return False.

handle_one_request()

Handle a single HTTP request.

You normally don’t need to override this method; see the class __doc__ string for information on how to handle specific HTTP commands such as GET and POST.

log_date_time_string()

Return the current time formatted for logging.

log_error(format, *args)

Log an error.

This is called when a request cannot be fulfilled. By default it passes the message on to log_message().

Arguments are the same as for log_message().

XXX This should go to the separate error log.

log_message(format: str, *args: Any) None[source]

Log messages from the BaseHTTPRequestHandler class.

log_request(code='-', size='-')

Log an accepted request.

This is called by send_response().

monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
parse_request()

Parse a request (internal).

The request should be stored in self.raw_requestline; the results are in self.command, self.path, self.request_version and self.headers.

Return True for success, False for failure; on failure, any relevant error response has already been sent back.

protocol_version = 'HTTP/1.0'
rbufsize = -1
responses = {HTTPStatus.CONTINUE: ('Continue', 'Request received, please continue'), HTTPStatus.SWITCHING_PROTOCOLS: ('Switching Protocols', 'Switching to new protocol; obey Upgrade header'), HTTPStatus.PROCESSING: ('Processing', 'Server is processing the request'), HTTPStatus.EARLY_HINTS: ('Early Hints', 'Headers sent to prepare for the response'), HTTPStatus.OK: ('OK', 'Request fulfilled, document follows'), HTTPStatus.CREATED: ('Created', 'Document created, URL follows'), HTTPStatus.ACCEPTED: ('Accepted', 'Request accepted, processing continues off-line'), HTTPStatus.NON_AUTHORITATIVE_INFORMATION: ('Non-Authoritative Information', 'Request fulfilled from cache'), HTTPStatus.NO_CONTENT: ('No Content', 'Request fulfilled, nothing follows'), HTTPStatus.RESET_CONTENT: ('Reset Content', 'Clear input form for further input'), HTTPStatus.PARTIAL_CONTENT: ('Partial Content', 'Partial content follows'), HTTPStatus.MULTI_STATUS: ('Multi-Status', 'Response contains multiple statuses in the body'), HTTPStatus.ALREADY_REPORTED: ('Already Reported', 'Operation has already been reported'), HTTPStatus.IM_USED: ('IM Used', 'Request completed using instance manipulations'), HTTPStatus.MULTIPLE_CHOICES: ('Multiple Choices', 'Object has several resources -- see URI list'), HTTPStatus.MOVED_PERMANENTLY: ('Moved Permanently', 'Object moved permanently -- see URI list'), HTTPStatus.FOUND: ('Found', 'Object moved temporarily -- see URI list'), HTTPStatus.SEE_OTHER: ('See Other', 'Object moved -- see Method and URL list'), HTTPStatus.NOT_MODIFIED: ('Not Modified', 'Document has not changed since given time'), HTTPStatus.USE_PROXY: ('Use Proxy', 'You must use proxy specified in Location to access this resource'), HTTPStatus.TEMPORARY_REDIRECT: ('Temporary Redirect', 'Object moved temporarily -- see URI list'), HTTPStatus.PERMANENT_REDIRECT: ('Permanent Redirect', 'Object moved permanently -- see URI list'), HTTPStatus.BAD_REQUEST: ('Bad Request', 'Bad request syntax or unsupported method'), HTTPStatus.UNAUTHORIZED: ('Unauthorized', 'No permission -- see authorization schemes'), HTTPStatus.PAYMENT_REQUIRED: ('Payment Required', 'No payment -- see charging schemes'), HTTPStatus.FORBIDDEN: ('Forbidden', 'Request forbidden -- authorization will not help'), HTTPStatus.NOT_FOUND: ('Not Found', 'Nothing matches the given URI'), HTTPStatus.METHOD_NOT_ALLOWED: ('Method Not Allowed', 'Specified method is invalid for this resource'), HTTPStatus.NOT_ACCEPTABLE: ('Not Acceptable', 'URI not available in preferred format'), HTTPStatus.PROXY_AUTHENTICATION_REQUIRED: ('Proxy Authentication Required', 'You must authenticate with this proxy before proceeding'), HTTPStatus.REQUEST_TIMEOUT: ('Request Timeout', 'Request timed out; try again later'), HTTPStatus.CONFLICT: ('Conflict', 'Request conflict'), HTTPStatus.GONE: ('Gone', 'URI no longer exists and has been permanently removed'), HTTPStatus.LENGTH_REQUIRED: ('Length Required', 'Client must specify Content-Length'), HTTPStatus.PRECONDITION_FAILED: ('Precondition Failed', 'Precondition in headers is false'), HTTPStatus.CONTENT_TOO_LARGE: ('Content Too Large', 'Content is too large'), HTTPStatus.URI_TOO_LONG: ('URI Too Long', 'URI is too long'), HTTPStatus.UNSUPPORTED_MEDIA_TYPE: ('Unsupported Media Type', 'Entity body in unsupported format'), HTTPStatus.RANGE_NOT_SATISFIABLE: ('Range Not Satisfiable', 'Cannot satisfy request range'), HTTPStatus.EXPECTATION_FAILED: ('Expectation Failed', 'Expect condition could not be satisfied'), HTTPStatus.IM_A_TEAPOT: ("I'm a Teapot", 'Server refuses to brew coffee because it is a teapot'), HTTPStatus.MISDIRECTED_REQUEST: ('Misdirected Request', 'Server is not able to produce a response'), HTTPStatus.UNPROCESSABLE_CONTENT: ('Unprocessable Content', 'Server is not able to process the contained instructions'), HTTPStatus.LOCKED: ('Locked', 'Resource of a method is locked'), HTTPStatus.FAILED_DEPENDENCY: ('Failed Dependency', 'Dependent action of the request failed'), HTTPStatus.TOO_EARLY: ('Too Early', 'Server refuses to process a request that might be replayed'), HTTPStatus.UPGRADE_REQUIRED: ('Upgrade Required', 'Server refuses to perform the request using the current protocol'), HTTPStatus.PRECONDITION_REQUIRED: ('Precondition Required', 'The origin server requires the request to be conditional'), HTTPStatus.TOO_MANY_REQUESTS: ('Too Many Requests', 'The user has sent too many requests in a given amount of time ("rate limiting")'), HTTPStatus.REQUEST_HEADER_FIELDS_TOO_LARGE: ('Request Header Fields Too Large', 'The server is unwilling to process the request because its header fields are too large'), HTTPStatus.UNAVAILABLE_FOR_LEGAL_REASONS: ('Unavailable For Legal Reasons', 'The server is denying access to the resource as a consequence of a legal demand'), HTTPStatus.INTERNAL_SERVER_ERROR: ('Internal Server Error', 'Server got itself in trouble'), HTTPStatus.NOT_IMPLEMENTED: ('Not Implemented', 'Server does not support this operation'), HTTPStatus.BAD_GATEWAY: ('Bad Gateway', 'Invalid responses from another server/proxy'), HTTPStatus.SERVICE_UNAVAILABLE: ('Service Unavailable', 'The server cannot process the request due to a high load'), HTTPStatus.GATEWAY_TIMEOUT: ('Gateway Timeout', 'The gateway server did not receive a timely response'), HTTPStatus.HTTP_VERSION_NOT_SUPPORTED: ('HTTP Version Not Supported', 'Cannot fulfill request'), HTTPStatus.VARIANT_ALSO_NEGOTIATES: ('Variant Also Negotiates', 'Server has an internal configuration error'), HTTPStatus.INSUFFICIENT_STORAGE: ('Insufficient Storage', 'Server is not able to store the representation'), HTTPStatus.LOOP_DETECTED: ('Loop Detected', 'Server encountered an infinite loop while processing a request'), HTTPStatus.NOT_EXTENDED: ('Not Extended', 'Request does not meet the resource access policy'), HTTPStatus.NETWORK_AUTHENTICATION_REQUIRED: ('Network Authentication Required', 'The client needs to authenticate to gain network access')}
send_error(code, message=None, explain=None)

Send and log an error reply.

Arguments are * code: an HTTP error code

3 digits

  • message: a simple optional 1 line reason phrase.

    *( HTAB / SP / VCHAR / %x80-FF ) defaults to short entry matching the response code

  • explain: a detailed message defaults to the long entry

    matching the response code.

This sends an error response (so it must be called before any output has been generated), logs the error, and finally sends a piece of HTML explaining the error to the user.

send_header(keyword, value)

Send a MIME header to the headers buffer.

send_response(code, message=None)

Add the response header to the headers buffer and log the response code.

Also send two standard headers with the server software version and the current date.

send_response_only(code, message=None)

Send the response header only.

server_version = 'BaseHTTP/0.6'
setup()
sys_version = 'Python/3.14.0'
timeout = None
version_string()

Return the server software version string.

wbufsize = 0
weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
class testplan.testing.multitest.driver.http.server.HTTPResponse(status_code: int | None = None, headers: dict | None = None, content: List[str] | None = None)[source]

Bases: object

HTTPResponse containing the status code, headers and content.

class testplan.testing.multitest.driver.http.server.HTTPServer(name: str, host: str = 'localhost', port: int = 0, request_handler: Type[BaseHTTPRequestHandler] = <class 'testplan.testing.multitest.driver.http.server.HTTPRequestHandler'>, handler_attributes: dict | None = None, timeout: int = 5, interval: float = 0.01, **options: Any)[source]

Bases: Driver

Driver for a server that can accept connection and send/receive messages using HTTP protocol.

{emphasized_members_docs}

Parameters:
  • name (str) – Name of HTTPServer.

  • host (str or ContextValue) – Hostname to connect to.

  • port (str or ContextValue) – Port to connect to.

  • request_handler (subclass of http.server.BaseHTTPRequestHandler) – Handles requests and responses for the server.

  • handler_attributes (dict) – Dictionary of attributes to be accessed from the request_handler.

  • timeout (int) – Number of seconds to wait for a response from the queue in the request_handler.

  • interval (int) – Time to wait between each attempt to get a response.

Also inherits all Driver options.

CONFIG

alias of HTTPServerConfig

EXTRACTORS: List[BaseConnectionExtractor] = [<testplan.testing.multitest.driver.connection.connection_extractor.ConnectionExtractor object>]
STATUS

alias of ResourceStatus

abort() None

Default abort policy. First abort all dependencies and then itself.

abort_dependencies() Generator[Entity, None, None]

Returns an empty generator.

property aborted: bool

Returns if entity was aborted.

aborting() None[source]

Abort logic that stops the server.

property active: bool

Entity not aborting/aborted.

property async_start: bool

Overrides the default async_start value in config.

property auto_start: bool

If False, the resource will not be automatically started by its parent (generally, a Environment object) while the parent is starting.

property cfg: Config

Configuration object.

property connection_identifier: int | None
property context: Environment | None

Key/value pair information of a Resource.

context_input(exclude: list | None = None) Dict[str, Any]

All attr of self in a dict for context resolution

define_runpath() None

Define runpath directory based on parent object and configuration.

property errpath: str | None

Path for stderr file regexp matching.

extract_values() bool | FailedAction

Extract matching values from input regex configuration options.

extracts: Dict[str, str]
failover() Resource | None

API to create the failover resource, to be implemented in derived class

fetch_error_log() List[str]

Fetch error message from the log files of driver, at first we can try self.errpath, if it does not exist, try self.logpath. Typically, several lines from the tail of file will be selected.

Returns:

text from log file

classmethod filter_locals(local_vars: Dict[str, Any]) Dict[str, Any]

Filter out init params of None value, they will take default value defined in its ConfigOption object; also filter out special vars that are not init params from local_vars.

Parameters:

local_vars

flush_request_queue() None[source]

Flush the received messages queue.

force_started() None

Change the status to STARTED (e.g. exception raised).

force_stop() None

Change the status to STOPPED (e.g. exception raised).

get_connections() List[BaseConnectionInfo]
get_full_request() ReceivedRequest | None[source]

Get a request sent to the HTTPServer, if the requests queue is empty return None.

Returns:

A request from the queue or None

get_request() str | None[source]

Get a request sent to the HTTPServer, if the requests queue is empty return None.

Returns:

A request from the queue or None

handler_attributes: dict | None
property host: str | None

Host name.

install_files() None

Installs the files specified in the install_files parameter at the install target.

interval: float | None
property is_alive: bool

Called to periodically poll the resource health. Default implementation assumes the resource is always healthy.

property local_host: str | None
property local_port: int | None
property logger: TestplanLogger

logger object

property logpath: str | None

Path for log regexp matching.

make_runpath_dirs() None

Creates runpath related directories.

property name: str

Driver name.

property outpath: str | None

Path for stdout file regexp matching.

property parent: Entity | None

Returns parent Entity.

pause() None

Pauses entity execution.

pausing() None

Pause the resource.

pending_work() bool

Resource has pending work.

property port: int | None

Port number assigned.

post_start() None

Steps to be executed right after resource is started.

post_stop() None

Steps to be executed right after resource is stopped.

pre_start() None

Steps to be executed right before resource starts.

pre_stop() None

Steps to be executed right before resource stops.

queue_response(response: HTTPResponse) None[source]

Put an HTTPResponse on to the end of the response queue.

Parameters:

response (HTTPResponse) – A response to be sent.

receive(timeout: int | None = None) ReceivedRequest | None[source]

Wait to receive a request.

Parameters:

timeout – Number of seconds to wait for a request, overrides timeout from init.

Returns:

A request or None

register_failover(klass: Type[Entity], params: dict) None

Register a failover class to instantiate if resource start fails.

Parameters:
  • klass – failover class

  • params – parameters for failover class __init__ method

property report: ReportLink

A handle to access the report via recursive parent

request_handler: Type[BaseHTTPRequestHandler] | None
requests: Queue[ReceivedRequest] | None
respond(response: HTTPResponse) None[source]

Put an HTTPResponse on to the end of the response queue.

Parameters:

response (HTTPResponse) – A response to be sent.

responses: Queue[HTTPResponse] | None
restart() None

Stop and start the resource.

resume() None

Resumes entity execution.

resuming() None

Resume the resource.

property runpath: str

Path to be used for temp/output files by entity.

property scratch: str

Path to be used for temp files by entity.

start() None

Triggers the start logic of a Resource by executing :py:meth: Resource.starting <testplan.common.entity.base.Resource.starting> method.

property start_timeout: float
started_check() bool | FailedAction

Predicate indicating whether driver has fully started.

Default implementation tests whether certain pattern exists in driver loggings, always returns True if no pattern is required.

property started_check_interval: float | Tuple[float, float]

Driver started check interval. In practice this value is lower-bounded by 0.1 seconds.

starting() None[source]

Start the HTTPServer.

property status: EntityStatus

Status object.

stop() None

Triggers the stop logic of a Resource by executing :py:meth: Resource.stopping <testplan.common.entity.base.Resource.stopping> method.

property stop_timeout: float
stopped_check() bool | FailedAction

Predicate indicating whether driver has fully stopped.

Default implementation immediately returns True.

property stopped_check_interval: float | Tuple[float, float]

Driver stopped check interval.

stopped_check_with_watch(watch: Any) bool | FailedAction
stopping() None[source]

Stop the HTTPServer.

timeout: int | None
property timer: Timer
uid() str

Driver uid.

wait(target_status: str | None, timeout: int | None = None) None

Wait until objects status becomes target status.

Parameters:
  • target_status (str) – expected status

  • timeout (int or NoneType) – timeout in seconds

class testplan.testing.multitest.driver.http.server.HTTPServerConfig(**options: Any)[source]

Bases: DriverConfig

Configuration object for HTTPServer driver.

classmethod build_schema() Schema

Build a validation schema using the config options defined in this class and its parent classes.

denormalize() Config

Create new config object that inherits all explicit attributes from its parents as well.

get_local(name: str, default: Any = None) Any

Returns a local config setting (not from container)

classmethod get_options() Dict[Any, Any][source]

Schema for options validation and assignment of default values.

ignore_extra_keys = False
property parent: Config | None

Returns the parent configuration.

set_local(name: str, value: Any) None

set without any check

class testplan.testing.multitest.driver.http.server.ReceivedRequest(method: str, path_url: str, headers: dict, raw_data: bytes, raw_requestline: bytes, requestline: str, request_version: str)[source]

Bases: object

Stores information of requests received by the HTTP Server.

property content_type: str | None

Returns the request’s content type

:return Content type header or None

property json: dict | None

Returns the request’s data in JSON format if exists

:return Request’s data in JSON format or None

Module contents

HTTP communication protocol drivers.