Fixing the PYTHONHASHSEED bug with our unittests

Switching from HTTPInternalServerError to HTTPServerError
as Pecan seems to be returning HTTPServerError instead.
For some reason the assertion only fails with specific
PYTHONHASHSEED's. As a result, I'm just making sure we
assert against the returned exception to correct the
issue for the moment.

Change-Id: Iad15fa17fc2c4d5c3642462df25e702aaff4801f
Partial-bug: #1348818
This commit is contained in:
John Vrbanac 2014-09-13 14:54:03 -05:00
parent ada968e162
commit 7ab190338d
2 changed files with 2 additions and 5 deletions

View File

@ -154,7 +154,7 @@ class BaseTestCase(utils.BaseTestCase):
"""
# The 'Read Error' clause needs to match that asserted in
# _assert_post_rbac_exception() above.
return exc.HTTPInternalServerError(message='Read Error')
return exc.HTTPServerError(message='Read Error')
def _assert_pass_rbac(self, roles, method_under_test, accept=None,
content_type=None):
@ -172,7 +172,7 @@ class BaseTestCase(utils.BaseTestCase):
# Force an exception early past the RBAC passing.
self.req.body_file = self._generate_stream_for_exit()
exception = self.assertRaises(exc.HTTPInternalServerError,
exception = self.assertRaises(exc.HTTPServerError,
method_under_test)
self._assert_post_rbac_exception(exception, role)

View File

@ -5,9 +5,6 @@ envlist = pep8,py26,py27,docs
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# Note the hash seed is set to 0 until barbican can be tested with a
# random hash seed successfully.
setenv = PYTHONHASHSEED=0
commands =
python setup.py testr --coverage