comparison 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
comparison
equal deleted inserted replaced
351:efbf7ba40287 352:2b209bdf6995
415 def test09_None_filter_embedded(self): 415 def test09_None_filter_embedded(self):
416 cfg = self._load() 416 cfg = self._load()
417 x = cfg.expand_variable("A{{non-existing|None}}Z") 417 x = cfg.expand_variable("A{{non-existing|None}}Z")
418 self.assertEquals("AZ", x) 418 self.assertEquals("AZ", x)
419 419
420 def test10_Empty_filtersingle(self):
421 cfg = self._load()
422 x = cfg.expand_variable("{{non-existing|Empty}}")
423 self.assertEquals("", x)
424
420 425
421 class T02LoadAndMerge(_T02MixinLoadAndMerge, unittest.TestCase): 426 class T02LoadAndMerge(_T02MixinLoadAndMerge, unittest.TestCase):
422 427
423 def setUp(self): 428 def setUp(self):
424 self._load = configmix.load 429 self._load = configmix.load