Fix error handling tests for pecan
The debug middleware always returns a 200 status, so disable it. The actual response status is the full string, not just the number, so look for that.
This commit is contained in:
parent
38f5dd2bfd
commit
2277370fca
@ -8,9 +8,8 @@ server = {
|
|||||||
app = {
|
app = {
|
||||||
'root' : 'test.controllers.root.RootController',
|
'root' : 'test.controllers.root.RootController',
|
||||||
'modules' : ['test'],
|
'modules' : ['test'],
|
||||||
'static_root' : '%(confdir)s/../../public',
|
'static_root' : '%(confdir)s/../../public',
|
||||||
'template_path' : '%(confdir)s/../templates',
|
'template_path' : '%(confdir)s/../templates',
|
||||||
'debug' : True,
|
|
||||||
'errors' : {
|
'errors' : {
|
||||||
'404' : '/error/404',
|
'404' : '/error/404',
|
||||||
'__force_dict__' : True
|
'__force_dict__' : True
|
||||||
@ -20,6 +19,6 @@ app = {
|
|||||||
# Custom Configurations must be in Python dictionary format::
|
# Custom Configurations must be in Python dictionary format::
|
||||||
#
|
#
|
||||||
# foo = {'bar':'baz'}
|
# foo = {'bar':'baz'}
|
||||||
#
|
#
|
||||||
# All configurations are accessible at::
|
# All configurations are accessible at::
|
||||||
# pecan.conf
|
# pecan.conf
|
||||||
|
@ -31,7 +31,7 @@ class TestWS(FunctionalTest):
|
|||||||
expect_errors=True
|
expect_errors=True
|
||||||
)
|
)
|
||||||
print res
|
print res
|
||||||
assert res.status == 400
|
self.assertEqual(res.status, '400 Bad Request')
|
||||||
a = json.loads(res.body)
|
a = json.loads(res.body)
|
||||||
print a
|
print a
|
||||||
assert a['faultcode'] == 'Client'
|
assert a['faultcode'] == 'Client'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user