pyeve / eve-sqlalchemy

SQLAlchemy data layer for Eve-powered RESTful APIs
http://eve-sqlalchemy.readthedocs.io
Other
232 stars 70 forks source link

Fix #68 honor ITEM_URL setting with no trickery #97

Closed ralphsmith80 closed 6 years ago

ralphsmith80 commented 8 years ago

Uses the dictionary get method providing the app.config value as the default so that settings.py values are not clobbered.

ralphsmith80 commented 8 years ago

My guess is the tests are failing because the eve-sqlalchemy was setting the item_url to 'regex("[0-9]+")' and now that the eve default is being used it's getting set to 'regex("[a-f0-9]{24}")'.

If that is the case the fix should be to add ITEM_URL = 'regex("[0-9]+")' to test_settings_sql.py.

ralphsmith80 commented 8 years ago

Not sure what's up with the tests now. Running the the py27 tests work on my system. The only difference I've noted is that the travis job is using python 2.7.9 and my system is using python 2.7.10.

Here's what my system output looks like.

ralphs@agentsmith:~/Workspace/eve-sqlalchemy     09:43:55 18-Dec
$ tox
GLOB sdist-make: /Users/ralphs/Workspace/eve-sqlalchemy/setup.py
py27 inst-nodeps: /Users/ralphs/Workspace/eve-sqlalchemy/.tox/dist/Eve-SQLAlchemy-0.4.2.dev0.zip
py27 installed: Cerberus==0.8.1,Eve==0.5.3,Eve-SQLAlchemy==0.4.2.dev0,Events==0.2.1,Flask==0.10.1,Flask-PyMongo==0.3.1,Flask-SQLAlchemy==2.1,funcsigs==0.4,itsdangerous==0.24,Jinja2==2.8,MarkupSafe==0.23,mock==1.3.0,pbr==1.8.1,py==1.4.31,pymongo==2.9.1,pytest==2.8.5,simplejson==3.8.1,six==1.10.0,SQLAlchemy==1.0.10,Werkzeug==0.10.4,wheel==0.24.0
py27 runtests: PYTHONHASHSEED='2754648542'
py27 runtests: commands[0] | py.test
============================================================================================ test session starts =============================================================================================
platform darwin -- Python 2.7.10, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
rootdir: /Users/ralphs/Workspace/eve-sqlalchemy, inifile: setup.cfg
collected 217 items 

eve_sqlalchemy/tests/delete.py ...........x....................
eve_sqlalchemy/tests/get.py .....x.......x.............................x...x.......................
eve_sqlalchemy/tests/patch.py ..............x................
eve_sqlalchemy/tests/post.py ............................
eve_sqlalchemy/tests/put.py ...........................
eve_sqlalchemy/tests/sql.py ....................
eve_sqlalchemy/tests/test_association_proxy.py ..
eve_sqlalchemy/tests/test_validation.py ..
eve_sqlalchemy/tests/test_validation_allow_unknown.py .
eve_sqlalchemy/tests/utils.py ...

=================================================================================== 211 passed, 6 xfailed in 19.92 seconds ===================================================================================
__________________________________________________________________________________________________ summary ___________________________________________________________________________________________________
  py27: commands succeeded
  congratulations :)
(venv)
ralphs@agentsmith:~/Workspace/eve-sqlalchemy     09:44:20 18-Dec
ralphsmith80 commented 8 years ago

Just used pyenv and pyenv-virtualenv to test with python 2.7.9 and test still pass on my machine.

ralphs@agentsmith:~/Workspace/eve-sqlalchemy     10:42:42 18-Dec
$ tox
GLOB sdist-make: /Users/ralphs/Workspace/eve-sqlalchemy/setup.py
py27 recreate: /Users/ralphs/Workspace/eve-sqlalchemy/.tox/py27
py27 installdeps: pytest, mock, git+git://github.com/nicolaiarocci/eve.git@v0.5.3#egg=Eve-0.5.3
py27 inst: /Users/ralphs/Workspace/eve-sqlalchemy/.tox/dist/Eve-SQLAlchemy-0.4.2.dev0.zip
py27 installed: Cerberus==0.8.1,Eve==0.5.3,Eve-SQLAlchemy==0.4.2.dev0,Events==0.2.1,Flask==0.10.1,Flask-PyMongo==0.3.1,Flask-SQLAlchemy==2.1,funcsigs==0.4,itsdangerous==0.24,Jinja2==2.8,MarkupSafe==0.23,mock==1.3.0,pbr==1.8.1,py==1.4.31,pymongo==2.9.1,pytest==2.8.5,simplejson==3.8.1,six==1.10.0,SQLAlchemy==1.0.10,Werkzeug==0.10.4,wheel==0.24.0
py27 runtests: PYTHONHASHSEED='2273566100'
py27 runtests: commands[0] | py.test
============================================================================================ test session starts =============================================================================================
platform darwin -- Python 2.7.9, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
rootdir: /Users/ralphs/Workspace/eve-sqlalchemy, inifile: setup.cfg
collected 217 items 

eve_sqlalchemy/tests/delete.py ...........x....................
eve_sqlalchemy/tests/get.py .....x.......x.............................x...x.......................
eve_sqlalchemy/tests/patch.py ..............x................
eve_sqlalchemy/tests/post.py ............................
eve_sqlalchemy/tests/put.py ...........................
eve_sqlalchemy/tests/sql.py ....................
eve_sqlalchemy/tests/test_association_proxy.py ..
eve_sqlalchemy/tests/test_validation.py ..
eve_sqlalchemy/tests/test_validation_allow_unknown.py .
eve_sqlalchemy/tests/utils.py ...

=================================================================================== 211 passed, 6 xfailed in 25.07 seconds ===================================================================================
__________________________________________________________________________________________________ summary ___________________________________________________________________________________________________
  py27: commands succeeded
  congratulations :)
(venv279)
ralphs@agentsmith:~/Workspace/eve-sqlalchemy     10:43:24 18-Dec
dkellner commented 7 years ago

Thank you for your contributions and sorry again for getting back to you so late! Can you rebase this on the current master branch and fix the commit messages? You refer to #86 when you should refer to #68 :).