changeset 340:176e22110fc5

docs, tests: notes and additional tests when quoting the "ref" namespace name
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 08 May 2021 19:19:35 +0200
parents ebd662a8376e
children ae4b76d0da45
files docs/introduction.rst tests/test.py
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/docs/introduction.rst	Sat May 08 18:55:39 2021 +0200
+++ b/docs/introduction.rst	Sat May 08 19:19:35 2021 +0200
@@ -452,6 +452,7 @@
 With ``{{ref:my.other.key}}``
 
 - special namespace ``ref``
+- can not be quoted currently in variable interpolation syntax
 - No special handling when merging is done
 - Keys within :meth:`.Configuration.getvar_s()` and
   :py:meth:`.Configuration.getvar()` are handled
@@ -490,6 +491,9 @@
 .. note:: Filters neeed no quoting -- and quoting within filters is *not*
           supported.
 
+.. note:: Quoting the ``ref`` namespace name does not work currently when
+          used in variable interpolation syntax.
+
 
 Custom filename extensions and custom loaders
 ---------------------------------------------
--- a/tests/test.py	Sat May 08 18:55:39 2021 +0200
+++ b/tests/test.py	Sat May 08 19:19:35 2021 +0200
@@ -807,6 +807,10 @@
         self.assertEqual(v1, v5)
         self.assertEqual(v1, v6)
 
+    def test_direct_ref_namespace_quoting(self):
+        v = self._cfg.getvar_s("re%x66:#%x23%u003a%x7c%U00000025%x2e.%x2e.%x3a.%x25.%x7c./.%x23")
+        self.assertEqual("value", v)
+
 
 if __name__ == "__main__":
     unittest.main()