summaryrefslogtreecommitdiffstats
path: root/tox.ini
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2015-07-15 17:55:05 +0200
committerChristian Heimes <cheimes@redhat.com>2015-07-15 21:19:54 +0200
commit9fa1d0c968977ef23e26556b0a8e8e76b32c7288 (patch)
tree9acac7d02a5020e204de639c69d25e70a4b654f7 /tox.ini
parent4aa89241e3a0423198cc6dce1f6f193eca74cac6 (diff)
downloadpki-9fa1d0c968977ef23e26556b0a8e8e76b32c7288.tar.gz
pki-9fa1d0c968977ef23e26556b0a8e8e76b32c7288.tar.xz
pki-9fa1d0c968977ef23e26556b0a8e8e76b32c7288.zip
Handle JSON decode error in handle_exceptions()
pki.handle_exceptions() raises a JSON decode exception when the body of the HTTPException is not a valid JSON string. The JSON exception hides the true error message. The patch also fixes a bug in PKIException.from_json(). The code and ClassName attribute are now correctly set. Finally we have our first unit test. https://fedorahosted.org/pki/ticket/1488 https://fedorahosted.org/freeipa/ticket/5129
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini6
1 files changed, 6 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
index 8b0c619c8..54ff3b873 100644
--- a/tox.ini
+++ b/tox.ini
@@ -25,6 +25,8 @@ envlist = py27,lint,docs
# force installation of sphinx and lint in virtual env, otherwise
# the command pick up the `pki` package from the system's site packages.
install_command = pip install {opts} --force-reinstall --upgrade {packages}
+deps =
+ pytest
[testenv:py27]
sitepackages = True
@@ -34,6 +36,7 @@ commands =
python2.7 {envbindir}/pki-server --help
python2.7 {envbindir}/pki-server-upgrade --help
python2.7 {envbindir}/pki-upgrade --help
+ py.test --capture=no --strict {posargs}
[testenv:lint]
basepython = python2.7
@@ -71,6 +74,9 @@ deps =
commands =
sphinx-build -v -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
+[pytest]
+python_files = tests/python/*.py
+
[flake8]
exclude = .tox,*.egg,dist,build,conf.py,tests/*
include = *.py,pki-upgrade,pkidestroy,pki-server,pki-server-upgrade,pkispawn,pki