A local ``httpbin`` server to run integration tests against. This ensures tests do not depend on `httpbin <https://httpbin.org/>`_.
Function | _certificates |
Create a self-signed CA certificate and server certificate signed by the CA. |
Function | _forever |
Run ``httpbin`` forever. |
Function | _make |
Return a :py:class:`Site` that hosts an ``httpbin`` WSGI application. |
Function | _output |
Write a process description to standard out. |
Function | _serve |
Serve a site over plain TCP. |
Function | _serve |
Serve a site over TLS. |
Create a self-signed CA certificate and server certificate signed by the CA. :param service_identity: The identity (hostname) of the server. :type service_identity: :py:class:`unicode` :param key_size: (optional) The size of CA's and server's private RSA keys. Defaults to 2048 bits, which is the minimum allowed by OpenSSL Contexts at the default security level. :type key_size: :py:class:`int` :return: a 3-tuple of ``(certificate_authority_certificate, server_private_key, server_certificate)``. :rtype: :py:class:`tuple` of (:py:class:`sslverify.Certificate`, :py:class:`OpenSSL.crypto.PKey`, :py:class:`OpenSSL.crypto.X509`)
Run ``httpbin`` forever. :param reactor: The Twisted reactor. :param argv: The arguments with which the script was ran. :type argv: :py:class:`list` of :py:class:`str` :return: a :py:class:`Deferred` that never fires.
Return a :py:class:`Site` that hosts an ``httpbin`` WSGI application. :param reactor: The reactor. :param threadpool_factory: (optional) A callable that creates a :py:class:`ThreadPool`. :return: A :py:class:`Site` that hosts ``httpbin``
Write a process description to standard out. :param description: The process description. :type description: :py:class:`_HTTPBinDescription` :param stdout: (optional) Standard out.
Serve a site over plain TCP. :param reactor: The reactor. :param host: The host on which to listen. :type host: :py:class:`str` :param port: The host on which to listen. :type port: :py:class:`int` :return: A :py:class:`Deferred` that fires with a :py:class:`_HTTPBinDescription`
Serve a site over TLS. :param reactor: The reactor. :param host: The host on which to listen. :type host: :py:class:`str` :param port: The host on which to listen. :type port: :py:class:`int` :type site: The :py:class:`Site` to serve. :return: A :py:class:`Deferred` that fires with a :py:class:`_HTTPBinDescription`