jpmckinney / validictory

🎓 deprecated general purpose python data validator
Other
240 stars 57 forks source link

Treat dict-like objects like dicts #52

Closed msabramo closed 11 years ago

msabramo commented 11 years ago

validictory currently only treats a true dict object as being of {"type": "object"}; it does not allow dict-like objects, like UserDict, sqlalchemy.engine.result.RowProxy, and webob.multidict.NestedMultiDict, to validate as {"type": "object"} -- this PR changes that.

Note that if you don't want to add test dependencies on sqlalchemy and webob, you can just cherry-pick ff81810, which adds no new dependencies.

marca@marca-mac:~/dev/git-repos/validictory$ tox
...
  py27: commands succeeded
  pypy: commands succeeded
  py33: commands succeeded
ERROR:   flake8: commands failed

The flake8 failure is from pre-existing issues (mostly lines that are too long).

aconrad commented 11 years ago

Yeah, I don't think we'd want to rely on sqlalchemy and webob for running the tests.

jamesturk commented 11 years ago

I've merged the first commit from this, thanks!