summaryrefslogtreecommitdiffhomepage
path: root/test/test_routing.py
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2019-05-30 16:47:39 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2019-05-30 16:47:39 +0300
commit67772cd3e9905820ef090b0ae52b571f542548f5 (patch)
tree6fe5d5caf1caf05ebe4621c203b2ba181ba25a21 /test/test_routing.py
parent90c5d3f5c0ad42ccdb764684f721b511131e0782 (diff)
downloadunit-67772cd3e9905820ef090b0ae52b571f542548f5.tar.gz
unit-67772cd3e9905820ef090b0ae52b571f542548f5.tar.bz2
Tests: fixed tests without "Host" header.
Diffstat (limited to 'test/test_routing.py')
-rw-r--r--test/test_routing.py29
1 files changed, 23 insertions, 6 deletions
diff --git a/test/test_routing.py b/test/test_routing.py
index f93ccd68..26d712a8 100644
--- a/test/test_routing.py
+++ b/test/test_routing.py
@@ -694,12 +694,6 @@ class TestRouting(TestApplicationProto):
)
self.assertEqual(
- self.get(headers={'Connection': 'close'})['status'],
- 404,
- 'match host positive empty',
- )
-
- self.assertEqual(
self.get(headers={'Host': 'localhost.', 'Connection': 'close'})[
'status'
],
@@ -731,6 +725,28 @@ class TestRouting(TestApplicationProto):
'match host positive example.com',
)
+ @unittest.skip('not yet')
+ def test_routes_match_host_absent(self):
+ self.assertIn(
+ 'success',
+ self.conf(
+ [
+ {
+ "match": {"host": "localhost"},
+ "action": {"pass": "applications/empty"},
+ }
+ ],
+ 'routes',
+ ),
+ 'match host absent configure',
+ )
+
+ self.assertEqual(
+ self.get(headers={'Connection': 'close'})['status'],
+ 400,
+ 'match host absent',
+ )
+
def test_routes_match_host_ipv4(self):
self.assertIn(
'success',
@@ -969,6 +985,7 @@ class TestRouting(TestApplicationProto):
200,
'match host empty 2',
)
+ self.assertEqual(self.get()['status'], 404, 'match host empty 3')
def test_routes_match_uri_positive(self):
self.assertIn(