58 Commits

Author SHA1 Message Date
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
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
Chris Dent
78d6b89d18 Enable real testing of python 3.4
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
2015-04-28 14:59:33 +01:00
Christophe de Vienne
292c556808 Make the flask adapter working with flask.ext.restful
Change-Id: I71d875f6579799b2881f76859fa88226dfea9b2b
2014-11-11 09:45:09 +01:00
Christophe de Vienne
c8337025e9 Avoid Sphinx 1.3x in the tests
Sphinx 1.3b at least changes the cli, leading to a test fail.

Change-Id: I841c11ff28294fdcb6a238fe100ba3b68aa4cf1c
2014-11-11 09:24:37 +01:00
Christophe de Vienne
2c29787386 Fix tox configuration.
-   Make sure tox-tmpl.ini and tox.ini are consistent

-   Avoid coverage 4.x

    Coverage 4.0a1 CLI is not happy with the commands we use in the unittests.
    Avoiding it for now.

Change-Id: I6976d4a94358692f5cb9570f672f6dd985f5d1b1
2014-10-01 12:59:49 +02:00
Ryan Petrello
7cee58bce9 Fix broken sphinx tests.
Change-Id: I2c2046b4ef31c78731f25f3b8e579b05ca0953fb
2014-09-23 13:25:09 -04:00
Julien Danjou
0638106e57 Run Flask tests by default
Change-Id: I122e642b43ed3498535663d3ed7a26cf5790ecfd
2013-10-11 17:58:43 +02:00
Julien Danjou
71c8bcf5d0 Enable and fix Sphinx tests
This remove the Sphinx environment and makes sure we run its test for
all Python version. This therefore fixes the test for Python 3.3.

Change-Id: Iba431e837d2b23761905155ff65ae909774ce0b2
2013-10-07 14:53:08 +02:00
Julien Danjou
259fea9529 types: fix error return when None is in Enum
Whe None is set as a valid value in an Enum, the error string that is
meant to be returned is built with a join() call on valid values.
However, that doesn't work as None isn't not a string.
Calling map(str, values) fixes this problem.

Also, if the value is invalid, the error code returned is 500 as if it
was the server fault. 400 should be returned instead, so rather than
raising a ValueError we raise an InvalidInput error.

Change-Id: I92695594676da2a247cef4e1e8fe277aa0972dea
2013-10-02 17:59:59 +02:00
Ryan Petrello
6bb3227165 Add a test environment against pecan's development (master) branch.
Change-Id: Id4c6a61be6a8ee9fa7d8ec1551c12ca448aa458f
2013-10-02 10:51:20 -04:00
Julien Danjou
abcdd7affa Include Pecan tests in default Python environment
- 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
2013-09-26 17:37:03 +02:00
Doug Hellmann
945d55c630 Update tox config to allow packaging jobs to work
Add a "venv" environment for pass-through commands like
what the packaging job uses.

Change-Id: I473d330fc7e8e149f674d21f22ccfc0e1855e88f
2013-09-11 11:07:59 -04:00
Ryan Petrello
f91767bf1e pep8 fixes, including a declaration in tox.ini for running flake8
Change-Id: I2adc6a5cbd76edd16e6079046b67b8fc10bf1671
2013-09-05 11:15:27 -04:00
Ryan Petrello
72c20e7ea1 Remove py25 and add 26 support to tox.
Change-Id: Ic178eaf7a4c30e2969cb504de0ef9a09e58c155c
2013-09-04 16:42:05 -04:00
Ryan Petrello
c367489c1f Remove a deprecated flag from tox.ini.
http://tox.readthedocs.org/en/latest/config.html#confval-downloadcache=path

Change-Id: Ib4f10b48db460ae0a537d9e646e1135753506cdb
2013-09-04 10:19:15 -04:00
Julien Danjou
a8eacfc26c Add a py33 tox target
Change-Id: I0b918caa1669e9a980b8abd510c5ccb0a3aa7d5e
2013-08-21 18:32:11 +02:00
Christophe de Vienne
8cfea4a0a1 Require a python2.5 compatible version of Jinja2 2013-06-21 01:52:53 +02:00
Christophe de Vienne
9cb0b58db6 More --nologcapture to run tests so that suds does not get in the way 2013-05-04 18:37:55 +02:00
Christophe de Vienne
df58de02aa use --nologcapture to avoid a nasty failure when suds do some logging 2013-05-04 18:26:50 +02:00
Christophe de Vienne
c1f08c40db Create some (incomplete) tests for the cornice adapter and fix it 2013-03-28 23:30:06 +01:00
Christophe de Vienne
606278be93 Downgrade webtest for tg11 and tg15 tests that are python2.5 based 2013-03-25 18:41:30 +01:00
Christophe de Vienne
773e5c88f2 Readd webtest for python 3 2013-03-25 18:06:19 +01:00
Christophe de Vienne
63e6e3ebe1 More python2.5 workaround 2013-03-25 17:33:45 +01:00
Christophe de Vienne
32534774c5 Workaround issues with python2.5 environment tests 2013-03-25 16:51:49 +01:00
Christophe de Vienne
6a8f3a8a9d flask is now part of the default test suite 2013-03-25 16:11:48 +01:00
Christophe de Vienne
5f99ad0edd Remove ipdb 2013-03-25 14:43:14 +01:00
Christophe de Vienne
737b794e07 New flask adapter + test (run "tox -e flask" to test) 2013-03-25 12:40:45 +01:00
Christophe de Vienne
be1d431182 Now use the awesome 'Cloud' sphinx theme 2013-01-30 00:29:42 +01:00
Christophe de Vienne
6d6b8e0ffb Do not test py25 with std json 2013-01-26 22:11:59 +01:00
Christophe de Vienne
e0a6a53cc8 Do not test py32 with sqlalchemy 0.5 anymore 2013-01-26 21:33:16 +01:00
Christophe de Vienne
07e52bbfc8 Don't install wsme-sqlalchemy and wsme-extdirect to build the doc anymore 2013-01-25 23:02:19 +01:00
Christophe de Vienne
e88fbb0d95 Add missing dependencies 2013-01-25 19:27:13 +01:00
Christophe de Vienne
3ecb245858 Now use toxgen to produce the tox.ini file 2013-01-25 17:40:32 +01:00
Christophe de Vienne
03b038b6bf Merge in wsme-soap 2013-01-24 22:26:42 +01:00
Christophe de Vienne
d431384339 tox -e doc now produce the zipped html documentation too 2013-01-18 12:18:43 +01:00
Christophe de Vienne
c32a19e298 Add a 'doc' testenv that builds the documentation
--HG--
extra : rebase_source : 8d95436155f065848450afd016b3b2d177bc4c91
2013-01-18 11:04:40 +01:00
Christophe de Vienne
fe291282aa Use nosetests --with-coverage instead of coverage run for testenv that tests wsmeext submodules (I have issues with the namespace module) 2013-01-18 01:11:19 +01:00
Christophe de Vienne
8736089dc9 Moved non-core features to the wsmeext namespace package
--HG--
rename : wsme/cornice.py => wsmeext/cornice.py
rename : wsme/pecan.py => wsmeext/pecan.py
rename : wsme/sphinxext.py => wsmeext/sphinxext.py
rename : wsme/tg1.py => wsmeext/tg1.py
rename : wsme/tg11.py => wsmeext/tg11.py
rename : wsme/tg15.py => wsmeext/tg15.py
2013-01-17 13:15:25 +01:00
Christophe de Vienne
98a89b808b Fix code coverage for pecan tests 2013-01-17 11:55:43 +01:00
Christophe de Vienne
af79bd4f37 Show missing lines in coverage reports 2013-01-17 11:18:18 +01:00
Christophe de Vienne
0c320363ad Now generate coverage reports for individual testenv
--HG--
extra : rebase_source : f01f2d4a18d467a73333f61f1b553a1de8122937
2013-01-16 21:39:49 +01:00
Christophe de Vienne
374e11be1c Adding a tg 2.1 test case (not enabled for now) 2012-11-26 16:38:50 +01:00
Christophe de Vienne
d3f1ba4884 Reorganise the tg1x adapters, and make the tg 1.5 adapter able to handle multiprotocol on 'native' rest 2012-11-26 13:55:27 +01:00
Christophe de Vienne
39cc2ffc8f The tg1 adapter can now expose rest functions outside the WSRoot _and_ enable other other protocols. Soap is tested. 2012-11-26 01:27:37 +01:00
Christophe de Vienne
c1ba69fa28 args_from_body now ignore empty bodies. 2012-11-08 15:02:59 +01:00
Christophe de Vienne
983ba099d7 The pecan adapter is now tested 2012-10-26 14:56:32 +02:00
Christophe de Vienne
0b2cf8df04 Adapter for cornice 2012-10-23 12:28:48 +02:00
Christophe de Vienne
938c6f5e13 Attempting a on-demand resolution of datatypes references, so we don't need to call resolve_references anymore. It works with python 2, but not yet python 3 (some weakref issues) 2012-06-04 19:22:32 +02:00
Christophe de Vienne
00c042aa73 Add tests for the sphinx extension, raising the total coverage over 95% 2012-05-18 12:02:35 +02:00