Somewhere along the way, WSME and flask/werkzeug have got out of sync
and tests have started failing. Since there aren't regular contributions
to WSME we don't catch these changes, so this may have happened months
or years ago.
I have adjusted tests to attempt to account for what I can, but one test
fails to work so I have marked it as an xfail. It works correctly with
werkzeug 1.13.x but not later. Since WSME is in something worse than
maintenance mode, I'm not inclined to fix this.
pep8/flake8 in python3 is more strict than python. The gate now
runs the pep8 jobs using python3 by default, so the local jobs
should as well. This changes the job and also fixes the new problems it
points out.
There are other failures, but they are present in master as well, so
leaving that for other changes.
Change-Id: I57ae0405e0d6ddba0bb1dac93020fb08a0fc7c89
* Use byte strings for HTTP body
* Remove debug print()
* tox.ini: add cornice-py3 test environment
Note: It looks like it doesn't work to inherit commands from cornice
into cornice-py3 because cornice commands use the substitution string
{posargs}.
Change-Id: Iaed39babc7ee9877d443c47c2f4b21b2e98b5181
Unit tests were still using the deprecated assertEquals instead of
assertEqual. This removes all mentions of assertEquals to use the new name and
be compatible with the OpenStack Style Guidelines.
Closes-Bug: #1454766
Partial-Bug: #1446692
Change-Id: Ieb90a334a0d0e91845d20a3e4ea4697307ed3f2a
The gate 34 tests were not running any tests because there was no
tox target. This changes tox-tmpl.ini (and the resulting tox.ini) to
add support for python 34 and remove support for anything that is
not py34 or py27-based.
To make the python3 tox environments work, the remote zip of a suds
fork has been replaced with suds-jurko, a relatively modern fork of
the original suds that supports python2 and 3.
Some tests needed to be fixed to deal with two main problems:
* reponse bodies being bytes
* Exceptions not having a .message attribute (.args[0] is used
instead)
* the test_flask tests were not being run for python3, they are now
* wsmeext/sphinxext.py intermittently fails due to the dictionary
changing size in flight, getting the keys prior to iteration fixes
it
Both 27 and 34 should be running 420 tests as of this commit.
Change-Id: I837c249714fd957790ea84aa2fd9ad994a39c5ea
This patch is extending the Response object and the Pecan extension
to make it possible to return a non-default return type (just like it
already supports retuning a non default status code).
This is useful when the return code of a function is 204 (No Response) for
that case we automatically set the return_type to be None and guarantee
that the response body is empty and the content-lentgh is 0. Which if
not done can cause tools consuming the API to misbehave.
Change-Id: I629c3e2d5dc169154e5af044f1b8f804e4b87e23
Older versions of werkzeug pass the description parameter back
in the description. As the description is never actually validated
in the test case, dropping it seems OK.
Change-Id: Icd547113d8fe918f35a97c4a5de220b3aaace5cd
Closes-Bug: 1242486
This makes sure that when the body is decoded we run the validation
process on it.
Fixes-Bug: #1220678
Change-Id: I765a6ce8c8097ef0e0a734804242e9fcee4ffbcf
Added custom error status code for ClientSideError
exception instead of hardcoded value 400.
Fixed case when user exception with client error code
formatted as server error.
Pecan extension fixed.
Change-Id: I2663db0aa88538b722eb2783d130585b0fc2335b
- Makes sure we always run Pecan test and that there's no regression.
There's no real need to split them out as they are not invasive.
Also that reduces the number of environment a bit.
- This also fixes Pecan tests on python2.6
- This also fixes Pecan tests on python3.3
- This also enables Pecan tests on python3.2
Change-Id: I57070b0bd785fb3d445f432973f15825abccbdd5
For this purposes I added addiitional processing of original
exceptions at wsme/wsmeext/pecan.py. For exception's validation
special validator was added to wsme/wsmeext/utils.py. Also
functionality was reworked to be compatible with python3.3
Fixes bug#1214073
Change-Id: Ib1cd0b274bda11f62298848ebcd55b3f6641757c