summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-03-22 01:58:56 +0100
committerAlejandro Colomar <alx.manpages@gmail.com>2022-05-16 12:57:37 +0200
commitc60f678485b986172b56a6367a581bb6d7668865 (patch)
tree8a2e2915ea1bf9b78cdca442973617d7853279ea
parent7066acb2ce438526fb0d60df443320d1c8366760 (diff)
downloadunit-c60f678485b986172b56a6367a581bb6d7668865.tar.gz
unit-c60f678485b986172b56a6367a581bb6d7668865.tar.bz2
Tests: Added tests for empty "location".
-rw-r--r--test/test_return.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_return.py b/test/test_return.py
index ff2e4566..82bf1e64 100644
--- a/test/test_return.py
+++ b/test/test_return.py
@@ -178,6 +178,21 @@ Connection: close
== "/#%23foo%3Fbar"
), '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 check_error(conf):
assert 'error' in self.conf(conf, 'routes/0/action')