A single HTTP request represented as a subclass of unittest.TestCase
The test case encapsulates the request headers and body and expected response headers and body. When the test is run an HTTP request is made using httplib2. Assertions are made against the reponse.
Bases: testtools.testcase.TestCase
Encapsulate a single HTTP request as a TestCase.
If the test is a member of a sequence of requests, ensure that prior tests are run.
To keep the test harness happy we need to make sure the setUp and tearDown are only run once.
Replace magic strings in message.
Run this request if it has not yet run.
If there is a prior test in the sequence, run it first.
Bases: exceptions.Exception
A catchall ServerError.
Decorate a test method that is expected to fail if ‘xfail’ is true.
Generate HTTP tests from YAML files
Each HTTP request is its own TestCase and can be requested to be run in isolation from other tests. If it is member of a sequence of requests, prior requests will be run.
A sequence is represented by an ordered list in a single YAML file.
Each sequence becomes a TestSuite.
An entire directory of YAML files is a TestSuite of TestSuites.
Bases: type
Metaclass to munge a dynamically created test.
Read YAML files from a directory to create tests.
Each YAML file represents an ordered sequence of HTTP requests.
Read and parse any YAML file. Let exceptions flow where they may.
Generate a TestSuite from YAML data.
Manage fixtures for gabbi at the test suite level.
Bases: object
A context manager that operates as a fixture.
Subclasses must implement start_fixture and stop_fixture, each of which contain the logic for stopping and starting whatever the fixture is. What a fixture is is left as an exercise for the implementor.
These context managers will be nested so any actually work needs to happen in start_fixture and stop_fixture and not in __init__. Otherwise exception handling will not work properly.
Implement the actual workings of starting the fixture here.
Implement the actual workings of stopping the fixture here.
Bases: exceptions.Exception
Generic exception for GabbiFixture.
Bases: gabbi.fixture.GabbiFixture
Start up the wsgi intercept. This should not be called directly.
Bases: gabbi.fixture.GabbiFixture
A fixture that skips all the tests in the current suite.
Nest a series of fixtures.
This is duplicated from nested in the stdlib, which has been deprecated because of issues with how exceptions are difficult to handle during __init__. Gabbi needs to nest an unknown number of fixtures dynamically, so the with syntax that replaces nested will not work.
A TestSuite for containing gabbi tests.
This suite has two features: the contained tests are ordered and there are suite-level fixtures that operate as context managers.
Bases: unittest.suite.TestSuite
A TestSuite with fixtures.
The suite wraps the tests with a set of nested context managers that operate as fixtures.
If a fixture raises unittest.case.SkipTest during setup, all the tests in this suite will be skipped.
Override TestSuite run to start suite-level fixtures.
To avoid exception confusion, use a null Fixture when there are no fixtures.