[tests][BREAK] arguments are not filtered (since version 0.6.20 probably)
This commit is contained in:
parent
5e21d4c24f
commit
039bc2c8fe
|
@ -55,18 +55,18 @@ ACLS = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def get(halfapi, data):
|
def get(data):
|
||||||
"""
|
"""
|
||||||
description:
|
description:
|
||||||
returns the configuration of the domain
|
returns the arguments passed in
|
||||||
"""
|
"""
|
||||||
logger.error('%s', data['foo'])
|
logger.error('%s', data['foo'])
|
||||||
return {'foo': data['foo'], 'bar': data['bar']}
|
return data
|
||||||
|
|
||||||
def post(halfapi, data):
|
def post(data):
|
||||||
"""
|
"""
|
||||||
description:
|
description:
|
||||||
returns the configuration of the domain
|
returns the arguments passed in
|
||||||
"""
|
"""
|
||||||
logger.error('%s', data)
|
logger.error('%s', data)
|
||||||
return {'foo': data['foo'], 'bar': data.get('bar', data.get('baz'))}
|
return data
|
||||||
|
|
|
@ -36,3 +36,20 @@ class TestDummyDomain(TestDomain):
|
||||||
assert res.status_code == 200
|
assert res.status_code == 200
|
||||||
assert isinstance(res.content.decode(), str)
|
assert isinstance(res.content.decode(), str)
|
||||||
assert res.headers['content-type'].split(';')[0] == 'text/html'
|
assert res.headers['content-type'].split(';')[0] == 'text/html'
|
||||||
|
|
||||||
|
def test_arguments__get_routes(self):
|
||||||
|
arg_dict = {'foo': '1', 'bar': '2', 'x': '3'}
|
||||||
|
res = self.client.get('/arguments?foo=1&bar=2&x=3')
|
||||||
|
assert res.json() == arg_dict
|
||||||
|
|
||||||
|
res = self.client.get('/arguments?foo=1&bar=2&x=3&y=4')
|
||||||
|
assert res.json() == arg_dict
|
||||||
|
|
||||||
|
def test_arguments_post_routes(self):
|
||||||
|
arg_dict = {'foo': '1', 'bar': '2', 'baz': '3'}
|
||||||
|
res = self.client.post('/arguments', arg_dict)
|
||||||
|
|
||||||
|
assert res.json() == arg_dict
|
||||||
|
|
||||||
|
res = self.client.post('/arguments', { **arg_dict, 'y': '4'})
|
||||||
|
assert res.json() == arg_dict
|
||||||
|
|
Loading…
Reference in New Issue