Tests for "index"

Alejandro Colomar (man-pages) alx.manpages at gmail.com
Tue Feb 22 09:24:53 UTC 2022


Hi Andrei,

Now I've got some pattern for the tests that are failing.
It seems that it's not interpreting $host as README in the tests, when 
we're setting Host to README.  With the following changes, all tests 
pass.  Do you have any idea why?

---
$ git diff -U6
diff --git a/test/test_static.py b/test/test_static.py
index 52c5270..5ddc368 100644
--- a/test/test_static.py
+++ b/test/test_static.py
@@ -97,28 +97,28 @@ class TestStatic(TestApplicationProto):
          assert self.get()['body'] == 'readme', 'index'

          self.conf_delete('routes/0/action/index')
          assert self.get()['body'] == '0123456789', 'delete index'

          set_index('$host')
-        assert (
-            self.get(headers={"Host": "README", "Connection": 
"close"})['body']
-            == 'readme'
-        ), 'index var'
+        #assert (
+            #self.get(headers={"Host": "README", "Connection": 
"close"})['body']
+            #== 'readme'
+        #), 'index var'
          self.get(headers={"Connection": "close"})[
              'status'
          ] == 404, 'index var empty'

          set_index(['blah'])
          self.get()['status'] == 404, 'index array not found'

          set_index(['$host', 'blah', 'index.html'])
          assert self.get()['body'] == '0123456789', 'index array'
          assert (
              self.get(headers={"Host": "README", "Connection": 
"close"})['body']
-            == 'readme'
+            == '0123456789'
          ), 'index array 2'

      def test_static_index_invalid(self, skip_alert):
          skip_alert(r'failed to apply new conf')

          def check_index(index):


-- 
Alejandro Colomar
Linux man-pages comaintainer; http://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



More information about the unit mailing list