class documentation

class HTTPBinProcessTests(SynchronousTestCase): (source)

View In Hierarchy

Tests for :py:class:`_HTTPBinProcesss`.

Method assertSpawnAndDescription Assert that spawning the given process invokes the command with the given args, that standard error is redirected, that it is killed at reactor shutdown, and that it returns a description that matches the provided one.
Method fd_recording_open Record the file descriptors of files opened by :py:func:`open`.
Method setUp Undocumented
Method spawned_process Assert that ``self.reactor`` has spawned only one process and return the :py:class:`SpawnedProcess` representing it.
Method test_kill Kill terminates the process as quickly as the platform allows, and the termination failure is suppressed.
Method test_kill_before_spawn Killing a process before it has been spawned has no effect.
Method test_kill_unexpected_exit The :py:class:`Deferred` returned by :py:meth:`_HTTPBinProcess.kill` errbacks with the failure when it is not :py:class:`ProcessTerminated`, or its signal does not match the expected signal.
Method test_server_description_caches_description :py:class:`_HTTPBinProcess.server_description` spawns an ``httpbin`` child process only once, after which it returns a cached :py:class:`_HTTPBinDescription`.
Method test_server_description_spawns_process :py:class:`_HTTPBinProcess.server_description` spawns an ``httpbin`` child process that it monitors with :py:class:`_HTTPBinServerProcessProtocol`, and redirects its standard error to a log file.
Method test_server_description_spawns_process_https :py:class:`_HTTPBinProcess.server_description` spawns an ``httpbin`` child process that listens over HTTPS, that it monitors with :py:class:`_HTTPBinServerProcessProtocol`, and redirects the process' standard error to a log file.
Instance Variable opened_file_descriptors Undocumented
Instance Variable reactor Undocumented
def assertSpawnAndDescription(self, process, args, description): (source)

Assert that spawning the given process invokes the command with the given args, that standard error is redirected, that it is killed at reactor shutdown, and that it returns a description that matches the provided one. :param process: :py:class:`_HTTPBinProcesss` instance. :param args: The arguments with which to execute the child process. :type args: :py:class:`tuple` of :py:class:`str` :param description: The expected :py:class:`_HTTPBinDescription`. :return: The returned :py:class:`_HTTPBinDescription`

def fd_recording_open(self, *args, **kwargs): (source)

Record the file descriptors of files opened by :py:func:`open`. :return: A file object.

def setUp(self): (source)

Undocumented

def spawned_process(self): (source)

Assert that ``self.reactor`` has spawned only one process and return the :py:class:`SpawnedProcess` representing it. :return: The :py:class:`SpawnedProcess`.

def test_kill(self): (source)

Kill terminates the process as quickly as the platform allows, and the termination failure is suppressed.

def test_kill_before_spawn(self): (source)

Killing a process before it has been spawned has no effect.

def test_kill_unexpected_exit(self): (source)

The :py:class:`Deferred` returned by :py:meth:`_HTTPBinProcess.kill` errbacks with the failure when it is not :py:class:`ProcessTerminated`, or its signal does not match the expected signal.

def test_server_description_caches_description(self): (source)

:py:class:`_HTTPBinProcess.server_description` spawns an ``httpbin`` child process only once, after which it returns a cached :py:class:`_HTTPBinDescription`.

def test_server_description_spawns_process(self): (source)

:py:class:`_HTTPBinProcess.server_description` spawns an ``httpbin`` child process that it monitors with :py:class:`_HTTPBinServerProcessProtocol`, and redirects its standard error to a log file.

def test_server_description_spawns_process_https(self): (source)

:py:class:`_HTTPBinProcess.server_description` spawns an ``httpbin`` child process that listens over HTTPS, that it monitors with :py:class:`_HTTPBinServerProcessProtocol`, and redirects the process' standard error to a log file.

opened_file_descriptors: list = (source)

Undocumented

reactor = (source)

Undocumented