Something has changed under the hood here and the test is now working
again. Fix things.
Change-Id: I15d3618c1b56b20af772e89385d5e450bb654ccb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Apparently this project uses templating for tox.ini..
Deprecate support for SQLAlchemy, since it has never worked in the first
place, and only officially supports ancient versions of SQLAlchemy.
Drops support for tgXX environments that do not do anything now.
Change-Id: Ia9b392f83ad4e9c1450a13c908813c7b6dbe74cb
It had been a long time since WSME had any patches, so the
tests had not been run in a while. This corrects errors found
while bring the tests back to work.
Change-Id: I67efc4151d6eaec673b431904aa7288a7501cb43
Co-Authored-By: 98k <18552437190@163.com>
It appears that in newer sphinx versions the index of :module:
directive in the resulting documenter object array has changed,
it is not the last element anymore. Apart from that, it is
possible to have several :module: entries in class for example.
This change fixes the issue for service, function and type
wsme documenters.
Change-Id: Icf44f8af0c1e6e70d8e921615efe03b845885be7
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
This patch is fixing the WSME Sphinx extension to work with Python 3.
The patch just checks the return value from the find_service_path()
method before it tries to do anything with it.
Change-Id: I5a4cfa42a8768ce35a1c1a999431e842c7dde020
Closes-Bug: #1657435
This patch is removing the quotes from "author" and "author-email"
metadata in the setup.cfg file. Apparently having the values quoted
causes the openstack-infra/project-config release.sh script to error out
when uploading it to Pypi.
This patch also updates the "url" metadata to point to the openstack git
server.
Change-Id: I992a5053a48f7a49f08f299b170cc3da40de242b
This change also adds cornice-py3 environment to tox-tmpl.ini,
as previously it was added manually directly in tox.ini.
Change-Id: I6c0924ca4cc7a42b57af01312da21b94ed1efa85
Currently readthedocs is unable to build the documentation because not all the
dependencies gets installed.
This patch add the wsme requirements to the doc requirements, with the hope
it fixes the build on readthedocs.
Change-Id: Ib17d3e77ec1eb0d200a0c478663c7cbd2710aed3
On Python 3, comparison between string (str) and integer (int) raises
a TypeError exception. I suggest to catch it to raise an InvalidInput
exception, as we already do for ValueError.
In practice, the TypeError was seen in OpenStack Cue tests on
Python 3, in a test passing a string to an attribute expecting an
integer, attribute having a minimum set (to an integer too).
Change-Id: I74103330ccb5cdc26aa3508fcefcc34310e00c27
Fix the failed test case
Traceback (most recent call last):
File "/opt/stack/wsme/wsme/tests/test_utils.py", line 78, in
test_parse_isodatetime
self.assertRaises(ValueError, utils.parse_isodatetime, s)
AssertionError: ValueError not raised
Change-Id: I6c36f8b0340cd7b4c6f35e7c7c5886598e2c5f0c
Closes-Bug: #1532734
* 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
When we parse the json object that come in query string,
we expect to find a dict, but not bail out if that not the case.
So this will raise a 500.
This changes this and return 400, because the input is invalid.
Change-Id: I1a3b927cdfb3b554026306d65a46ed91635d073c
Closes-bug: #1423634
When the body of a POST request cannot be decoded because
the content-type is not supported by any rest controller.
The server should return 415, not 500.
Related bug: #1419110
Change-Id: I8f8df4ab4062181e8d511e437a8486182c262ff8
If the expected datatype is ArrayType or DictType
but the json value is something else raise
ValueError instead of 500 erro because we can browse the
dict or the list.
Closes bug: #1428628
Change-Id: Ibd4d95815c0b81ded8304bba4ca83e6df32d86ae
If the object type is ArrayType or DictType, the datatype
is an object not a class. Currently a 500 error is raise
just because the exception path for invalid input handle only
when the datatype is an UserType or Class, not object.
This change fixes that.
Change-Id: Ifadef698a4dca0d33167bd4d5a567c43fe015108
Closes-bug: #1428185
Update the README file to list links in a format expected by the
OpenStack release tools so we can generate release announcement emails
automatically.
Change-Id: I84865bc1787ad980c65e49f7b6ae40c66d92b4e7
Set up the venv environment to let us use it for pre-release cross
testing to ensure we don't break consuming project unit tests.
Change-Id: If2bee203cb120b6c3b17a863fca2ece12651024f
Add an example in the documentation to show how to configure pyramid to
use the WSME extensions with cornice.
Closes-Bug: #1316888
Change-Id: Id1ad7149260205809de0b7f8ded51d45a8390880
Ipaddr module was never introduced by openstack and never used by
other openstack components. We should move to more reliable module
netaddr to validate ip format.
Change-Id: I38d0c6f4ea2147ce071ab62a7c9d546436aec185
Closes-Bug: #1455404
pytz was used in https://review.openstack.org/#/c/161013 but is not a WSME
dependency. This causes pecan test, which gates against WSME, to fail.
Change-Id: I71e60648a08f019c0da355ba2d25ea05d6fcdf2f
Fix the documentation where it sais that wsme.signature takes a status
argument: the actual name of the argument is status_code.
Closes-Bug: #1455563
Change-Id: Ifa3abef5654e5b796285a467fe5e6bce248ef60c
Check if a request is passing more attributes for complex objects than
those defined in the API. WSME did not care if some unknown attribute
was passed to an API with a complex type, only checking the required
attributes. This is fixed raising a ValueError if more attributes are
given than expected, resulting in an HTTP response with a 400 status.
This helps check the validity of requests, which would otherwise
unexpectedly work with (partially) invalid data.
Closes-Bug: #1277571
Change-Id: Idf720a1c3fac8bdc8dca21a1ccdb126110dae62e
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
Add some tests to verify that UserType objects are correctly converted
to the specified basetype. Bug #1228040 was based on a wrong usage of
the UserType base class, so these also stand as a further example of
correct usage.
Related-Bug: #1228040
Change-Id: I7d50164930c2ae7abeddcade4f876eef5b273b6b
If on a service exposed with some arguments with a built-in type among
int, long, bool or float a request is made passing a JSON with string
values instead of the intended type, the called function would have
strings as parameters instead of the expected types. This also means
that invalid strings would still be passed without error, leading to
unexpected failures. This patch tries to convert the string to the
intended type before failing with an InvalidInput exception if the
string can't be converted. This is to try and be as nice as possible
with whatever input is thrown at wsme.
Closes-Bug: 1450544
Change-Id: I705c183bb68457d539074b78ce81339b9464e1e0