diff tests/test.py @ 352:2b209bdf6995

Implement the "Empty" filter. This is like the "None" filter but returning an empty string instead of None.
author Franz Glasner <f.glasner@feldmann-mg.com>
date Thu, 24 Jun 2021 19:26:53 +0200
parents efbf7ba40287
children 260354e9a7f9
line wrap: on
line diff
--- a/tests/test.py	Thu Jun 24 19:23:06 2021 +0200
+++ b/tests/test.py	Thu Jun 24 19:26:53 2021 +0200
@@ -417,6 +417,11 @@
         x = cfg.expand_variable("A{{non-existing|None}}Z")
         self.assertEquals("AZ", x)
 
+    def test10_Empty_filtersingle(self):
+        cfg = self._load()
+        x = cfg.expand_variable("{{non-existing|Empty}}")
+        self.assertEquals("", x)
+
 
 class T02LoadAndMerge(_T02MixinLoadAndMerge, unittest.TestCase):