testplan.exporters.testing.http package

Module contents

HTTP exporter for uploading test reports via HTTP transmission. The web server must be able to handle POST request and receive data in JSON format.

class testplan.exporters.testing.http.CustomJsonEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

To jsonify data that cannot be serialized by default JSONEncoder.

default(obj: Any) → str[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
class testplan.exporters.testing.http.HTTPExporter(name: str = 'HTTP exporter', **options)[source]

Bases: testplan.common.exporters.BaseExporter

HTTP exporter.

Parameters:
  • http_url (str) – Http url for posting data.
  • timeout (int) – Connection timeout.

Inherits all Exporter options.

CONFIG

alias of HTTPExporterConfig

export(source: testplan.report.testing.base.TestReport, export_context: Optional[testplan.common.exporters.ExportContext] = None) → Optional[Dict[KT, VT]][source]

Uploads report to remote HTTP server.

Param:source: Testplan report to export
Param:export_context: information about other exporters
Returns:dictionary containing the possible output
class testplan.exporters.testing.http.HTTPExporterConfig(**options)[source]

Bases: testplan.common.exporters.ExporterConfig

Configuration object for HTTPExporter object.

classmethod get_options()[source]

Override this classmethod to provide extra config arguments.