From 3b7b2fae54b7c11e979552f13f7f315775673981 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 3 Mar 2020 17:54:02 +0000 Subject: Tests: check unique options in "action" object. --- test/test_routing.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'test/test_routing.py') diff --git a/test/test_routing.py b/test/test_routing.py index f03c0bb3..be00d733 100644 --- a/test/test_routing.py +++ b/test/test_routing.py @@ -294,6 +294,56 @@ class TestRouting(TestApplicationProto): 'route pass absent configure', ) + def test_routes_action_unique(self): + self.assertIn( + 'success', + self.conf( + { + "listeners": { + "*:7080": {"pass": "routes"}, + "*:7081": {"pass": "applications/app"}, + }, + "routes": [{"action": {"proxy": "http://127.0.0.1:7081"}}], + "applications": { + "app": { + "type": "python", + "processes": {"spare": 0}, + "path": "/app", + "module": "wsgi", + } + }, + } + ), + ) + + self.assertIn( + 'error', + self.conf( + {"proxy": "http://127.0.0.1:7081", "share": self.testdir}, + 'routes/0/action', + ), + 'proxy share', + ) + self.assertIn( + 'error', + self.conf( + { + "proxy": "http://127.0.0.1:7081", + "pass": "applications/app", + }, + 'routes/0/action', + ), + 'proxy pass', + ) + self.assertIn( + 'error', + self.conf( + {"share": self.testdir, "pass": "applications/app"}, + 'routes/0/action', + ), + 'share pass', + ) + def test_routes_rules_two(self): self.assertIn( 'success', -- cgit