Tests: Added tests for empty "location".
This commit is contained in:
@@ -178,6 +178,21 @@ Connection: close
|
|||||||
== "/#%23foo%3Fbar"
|
== "/#%23foo%3Fbar"
|
||||||
), 'location with a variable with encoding'
|
), 'location with a variable with encoding'
|
||||||
|
|
||||||
|
assert 'success' in self.conf(
|
||||||
|
'""', 'routes/0/action/location'
|
||||||
|
), 'location empty'
|
||||||
|
assert self.get()['headers']['Location'] == ''
|
||||||
|
|
||||||
|
assert 'success' in self.conf(
|
||||||
|
'"${host}"', 'routes/0/action/location'
|
||||||
|
), 'location empty with variable'
|
||||||
|
assert (
|
||||||
|
self.get(headers={"Host": "", "Connection": "close"})['headers'][
|
||||||
|
'Location'
|
||||||
|
]
|
||||||
|
== ""
|
||||||
|
), 'location with empty variable'
|
||||||
|
|
||||||
def test_return_invalid(self):
|
def test_return_invalid(self):
|
||||||
def check_error(conf):
|
def check_error(conf):
|
||||||
assert 'error' in self.conf(conf, 'routes/0/action')
|
assert 'error' in self.conf(conf, 'routes/0/action')
|
||||||
|
|||||||
Reference in New Issue
Block a user