This may not be fully adequate but is a reasonable start. The main
point was to indicate the different loader method and the need
to yield the generated tests.
This feature was effectively already there but not fleshed out in
tests nor documentation. Now there are some tests and a short
piece of documentation with a light warning about avoiding overuse.
A slight adjustment was required in data handling to deal with
empty lists and empty objects.
Fixes #113
After much discussion this was determined to be the easiest and
cleanest way to accomplish a test which asserts "this header must
not be present". The ResponseHandler framework is used to good
effect to make short code.
The value of the response_forbidden_headers is a list of headers.
Case will be normalized to lower, which matches the internal
representation of the response headers dictionary.
Fixes #108
Originally there was no tests dir. When unit-like tests were added
they were put in a newly created tests directory. Since it is there
may as well use it.
previously keys were documented as a lengthy list in seemingly arbitrary
order - in contrast, this structure promises to be more comprehensible
(and less daunting), plus table layout should improve readability and
scannability by providing some visual consistency
note that this inevitably led to various editorial changes
This adds a query_parameters field which can be used to add query
parameters to the url of the test in which it is used. It is a dict in
a form suitable for being passed to the urlencode() method.
This change is cumbersome because urlencoded in python2 and 3 have
different behaviors: In python2 a utf-8 encoded string is required.
In 3 it will figure out the right thing. So we here we just encode.
We also need to deal with the fact that a numeral in YAML will be
provided to Python as a numeric value and we need to stringify that in
a version independent fashion.
Until this change only response bodies with a content-type of
'application/json' were decoded from JSON and stored in the
json_data attribute. Now '+json' style content-types also get the
same treatment.
json_data is the attribute later used when checking
response_json_paths. An expectation of a correct content type has
always been present but the docs have been update to make this
clear.
In the future when other content types will have handling similar to
JSON, this processing will need to be encapsulated in the
implementations of each content type handler. This fix is short
term.
A prefix is applied to all the unqualifed URLs in a suite of tests.
This is useful for testing live applications that are mounted at
different points under a wsgi server.
Fixes #46
The assumption is that when using those strings we actually want
booleans, additional there are a few BASE_TEST keys for which the
value is expected to be boolean and using an environment value
(which would always be a string if used directly) will not work (as
there is no way to indicate False).
Fixes #40
This makes it possible for stop_fixture to decide if it wants to
cleanup or not. For some exceptions it might not make sense.
To test this, non-gabbi tests now exist in gabbi/tests/ with the
dreaded introduction of mocks.