summaryrefslogtreecommitdiffhomepage
path: root/test/test_variables.py
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2021-08-19 18:17:12 +0300
committerAndrei Belov <defan@nginx.com>2021-08-19 18:17:12 +0300
commitdb442f1be7e713e6a219621ff97a51046590dbd6 (patch)
tree913734275bc890ec175e51fcb0f36b01a3c52c24 /test/test_variables.py
parenta1d2ced6fc2317d36bc917c5d0ac339bc647dc34 (diff)
parent13c0025dfa6e041563d0ad5dd81679b44522694c (diff)
downloadunit-db442f1be7e713e6a219621ff97a51046590dbd6.tar.gz
unit-db442f1be7e713e6a219621ff97a51046590dbd6.tar.bz2
Merged with the default branch.1.25.0-1
Diffstat (limited to 'test/test_variables.py')
-rw-r--r--test/test_variables.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_variables.py b/test/test_variables.py
index 139d867e..d8547b7b 100644
--- a/test/test_variables.py
+++ b/test/test_variables.py
@@ -100,6 +100,25 @@ class TestVariables(TestApplicationProto):
assert self.get(url='/1')['status'] == 200
assert self.get(url='/2')['status'] == 404
+ def test_variables_empty(self):
+ def update_pass(prefix):
+ assert 'success' in self.conf(
+ {
+ "listeners": {
+ "*:7080": {"pass": prefix + "/$method"},
+ },
+ },
+ ), 'variables empty'
+
+ update_pass("routes");
+ assert self.get(url='/1')['status'] == 404
+
+ update_pass("upstreams");
+ assert self.get(url='/2')['status'] == 404
+
+ update_pass("applications");
+ assert self.get(url='/3')['status'] == 404
+
def test_variables_invalid(self):
def check_variables(routes):
assert 'error' in self.conf(