When gabbi-run is passed one or more files, set the working
directory for the associated test suite as the directory of
each test file. Doing so ensures that `<@file` syntax in the
YAML has a fixed point from which to find the data files.
If data comes from STDIN then the test directory is '.' (as
it has always been).
Fixes #184
If a request or response body is JSON, then use the loads and dumps
methods on the JSON content handler to present it in a pretty
fashion. See the TODO in gabbi/httpclient.py for future expansion
options.
This reuses a test_verbose.yaml file added in pull request #183
that didn't seem to be doing anything.
Tests for this are in test_runner.py as it provides useful stdout
capturing infrastructure.
Fixes #182
This gets the basics in a very simplistic fashion.
What's missing is any indication of the availability of this feature
in the argparse created help (the output one sees from
gabbi-run --help). It's not clear what the best way to add this is,
since the feature is being managed outside argparse.
This is probably a personal preference not a technical one, given that
we are going to be making two separate calls to run_suite, it makes more
sense to make that choice outside of a for loop, not within it. This
makes the reason for the different calls a bit more evident and means
that everything in the input_files list is of the same type and no type
checking is required.
It turns out that though the fixtures will be run when using the
latter the 'details' capturing (which is rather the point of using
the fixtures) will only happen when using testtools.
An inner fixture is a fixture that runs per test, rather than
per test file. As implemented these fixtures are of the class
fixtures.Fixture from the python package 'fixtures'[1].
The way in which these are useful is for capturing per-test
output (stdout, stderr, logs and the like) or otherwise performing
setUp and cleanUp before and after an individual test. In many
cases this is not something that is needed in a simple gabbi run
but in some contexts (for example those with many tests in a broadly
concurrent environment) it can be important to chunkify any stray
output that the tests produce and lump it with an individual test in
a way that doesn't get interleaved with multiple streams of output.
By default nothing changes, but if someone uses the inner_fixtures
argument to build_tests and passes some fixtures (the docs will be
updated in later commits) they will be used.
This is a first commit that is not fully working but demonstrates
the concept. The tests are not working well because of global
state in the response handlers messing with this. Will fix that
elsewhere.
Regex handlings was added to the right hand side of json path
expressions. This updates the content-handlers branch to support
them and merges up to master.
When running gabbi by default the pretty name of the test
(displayed in test results) has a 'gabbi.suitemaker' prefix. This
can be disorienting when reviewing result sets or trying to track
those results to where in a code tree the gabbi tests are loaded.
This change allows the __module__ of the test classes that are
dynamically created to be override with the test_loader_name
that is passed in to to the build_tests method. By setting this
to __name__ the test is appropriately situated in its context. The
gist of this change can be seen on the diff to test-limit.sh.
Note that this has also been tested in OpenStack Nova, which
was the source of this need. There tests which were showing up with
the name:
gabbi.suitemaker.test_placement_api_inventory_get_that_inventory.\
test_request
have become:
nova.tests.functional.api.openstack.placement.\
test_placement_api.inventory_get_that_inventory.test_request
By default nothing has changed. This change only impact situations where
test_loader_name is used.
Add a faq.rst and two simple questions to get the ball rolling
on having a gabbi faq in the docs.
This format probably won't scale in the long run, but is useful in
the short run and while the format might become lame the content
will not.