749 Commits

Author SHA1 Message Date
Stephen Finucane
7a85c8a5ac gitignore: Ignore '.eggs' directory
Change-Id: Id259eb8bd0902d987822a308b42f9b0284035c6c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-05-02 09:40:40 -06:00
Stephen Finucane
2606e64e5e Mark tests as passing again
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>
2019-05-02 09:10:52 -06:00
Zuul
1d73d6e504 Merge "Update the tox.ini template and regenerate tox.ini" 2019-03-14 16:03:53 +00:00
Zuul
e59a014a7e Merge "Move CI jobs in-tree, add Python 3.6 and 3.7" 2019-03-14 15:45:15 +00:00
Cyril Roelandt
1b5ca365b4 Fix overindentation
Without this fix, "tox -epep8" fails.

Change-Id: I5c95add72735fd3c01b22a84b07ccf8d78e86aa2
2019-03-12 20:41:43 +01:00
Dmitry Tantsur
ac9c58cd6c Update the tox.ini template and regenerate tox.ini
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
2019-03-12 14:25:03 +01:00
Dmitry Tantsur
f054ccbf4d Move CI jobs in-tree, add Python 3.6 and 3.7
Fixes a pep8 error that managed to sneak in.

Change-Id: I90b91a69537934fd279bda808aae2d2c653b17e1
2019-03-12 12:20:36 +01:00
Chris Dent
3957f12aa2 Get WSME tests working again
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>
2018-11-12 16:16:30 +01:00
zhulingjie
9d2d21e4c1 Python 3 compatibility: fix xrange/range issues
xrange is not defined in python3. update it to range.

Change-Id: I5de140e4107980383682138b53973488f92fa54e
Closes-Bug: #1797768
2018-10-09 04:10:17 -04:00
qingszhao
033b03fa19 Removed older version of python added 3.5
In setup.cfg file the python 3.5 is added

Change-Id: I46c9d28f4dae0bba29af14e8beb4515d1d59fbd7
2018-09-30 10:07:52 +08:00
Vladyslav Drok
f36a607124 Improve handling of :module: in wsme documenters
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
0.9.3
2018-06-27 10:34:05 +03:00
Vladyslav Drok
6dc053296f Change flask restful module name
It moved from flask.ext.restful to flask_restful.

Change-Id: I160e665976b13a263ee04a0472b67c0fd99e218d
2018-06-26 19:59:32 +03:00
Zuul
7498845c68 Merge "fix a typo in documentation" 2018-04-11 11:00:38 +00:00
melissaml
256dca7a71 fix a typo in documentation
Change-Id: I9696d3d12f4ab24505e223e6737a306e1f82e4f5
2018-04-11 14:44:36 +08:00
Chris Dent
1440eeb13b Fix (some) tests for modern flask and pep8
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
2018-04-09 13:24:20 +01:00
Sanu Madhavan
9f84e4c7c5 Remove white space between print ()
There was a white space between print and ()

Change-Id: I6793e52c441728e991fe61afb73227e16368d758
0.9.2
2017-01-20 15:38:05 +05:30
Lucas Alvares Gomes
7e96104e7b Fix: Sphinx extension on Python3
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
2017-01-18 12:08:57 +00:00
Lucas Alvares Gomes
9676ffcd1d Fix the setup.cfg metadata
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
0.9.1
2017-01-04 14:43:55 +00:00
Vladyslav Drok
1670793bfe Print exceptions raised from from_param methods
This makes debugging the problems easier.

Change-Id: I285d8176b8cfb0cdf1e9cecd8ae5a0a7f0f109e7
0.9.0
2016-12-23 14:09:16 +02:00
Vladyslav Drok
ecaf3aa40f Fix pep8 issues and switch to py35 in tox.ini
This change also adds cornice-py3 environment to tox-tmpl.ini,
as previously it was added manually directly in tox.ini.

Change-Id: I6c0924ca4cc7a42b57af01312da21b94ed1efa85
2016-12-23 14:02:33 +02:00
Christophe de Vienne
42e1239e9d [doc] Complete doc requirements
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
2016-03-08 11:30:20 +00:00
Christophe de Vienne
b749712221 Add the 0.8.0 changes list
Change-Id: Ib1c9daa74702134945fdda04b6e31c196154e37c
2016-03-08 11:29:03 +00:00
Jenkins
f621576b9f Merge "Port test_cornice to Python 3" 2016-03-08 11:28:12 +00:00
Victor Stinner
4a57d81b4a wsattr.__set__() catchs TypeError
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
2016-03-08 11:21:06 +01:00
houming-wang
30bb63a6f5 Fix jenkins failure
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
2016-03-08 09:40:15 +00:00
Victor Stinner
6560133d79 Port test_cornice to Python 3
* 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
2016-03-08 10:31:21 +01:00
venkatamahesh
5376fe2f0e Change the repositories from stackforge to openstack
Change-Id: Ia3fced3c026fe6f8a039a584b99f8d44f8a8b3f4
2015-10-19 14:51:33 +05:30
Jeremy Stanley
37aad0e15d Update .gitreview for new namespace
Change-Id: I2164db3323c1c1330c977652c46a2f18c49fa76e
2015-10-17 22:41:53 +00:00
Mehdi Abaakouk
1dc4421b4f Return 400, if the query string is not a dict
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
0.8.0
2015-08-07 12:47:18 +02:00
Jenkins
7784cc73b1 Merge "rest: return 415 when content-type is invalid" 2015-08-07 09:28:25 +00:00
Jenkins
52f756a9de Merge "Complex types should check unexpected attributes" 2015-08-07 09:28:13 +00:00
Mehdi Abaakouk
078cd72365 rest: return 415 when content-type is invalid
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
2015-08-04 08:45:58 +02:00
Mehdi Abaakouk
03f0c0b4d6 json: raise ValueError invalid list or dict
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
2015-08-03 16:06:09 +02:00
Mehdi Abaakouk
2cb266eadb Fixes exception path with the datatype is a Object
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
2015-08-03 16:06:09 +02:00
Jenkins
1526b4ce62 Merge "Update README formatting for release tools" 2015-07-22 15:14:29 +00:00
Doug Hellmann
1fef3f2714 Update README formatting for release tools
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
2015-06-01 16:44:34 +00:00
Doug Hellmann
e6d471be88 Set up dependencies for cross-tests
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
2015-06-01 13:53:09 +00:00
Jenkins
43e125ded9 Merge "Move ipaddr to netaddr" 0.7.0 2015-05-29 13:04:49 +00:00
Stéphane Bisinger
9b3e71e2ac Add instructions to configure cornice with WSME
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
2015-05-28 12:52:26 +02:00
Lan Qi song
002473c0ea Move ipaddr to netaddr
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
2015-05-27 23:20:40 +08:00
Ryan Petrello
d60de97edc Add pytz as a dependency.
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
2015-05-27 09:51:31 -04:00
Jenkins
0f2516ef1c Merge "Added timezone support to parse_isodatetime" 2015-05-26 20:45:23 +00:00
Stéphane Bisinger
a88c83001f Fix wrong reference to status argument in the docs
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
2015-05-26 17:29:45 +00:00
Michael Krotscheck
3ea152cab0 Added timezone support to parse_isodatetime
Timezones are added to datetime() and time() instances
using pytz's FixedOffset.

Change-Id: I2484c5cd924348305e681dc2902bafd19c75eb6e
2015-05-22 09:36:39 -07:00
Stéphane Bisinger
6461c1b8a1 Complex types should check unexpected attributes
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
2015-05-18 12:39:50 +02:00
Jenkins
f28ec1354e Merge "Replace deprecated assertEquals with assertEqual" 2015-05-14 14:24:51 +00:00
Stéphane Bisinger
32456d3e47 Replace deprecated assertEquals with assertEqual
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
2015-05-13 18:35:41 +02:00
Chris Dent
7379a3a88e Update changes doc
Prepare for a 0.7.0 release.

Change-Id: Ic4cb1e540ea1087cc0d3c12a76dfe00939e481c2
2015-05-13 12:32:46 +00:00
Stéphane Bisinger
d2f8f8fb1c Ensure UserType objects are converted to basetype
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
2015-05-07 17:05:09 +02:00
Stéphane Bisinger
9a0d3c1461 Convert built-in types when passed as strings
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
2015-05-06 23:04:18 +02:00