def test_missing_key_not_substituted(self): f = module.Filter() stream = StringIO() yaml.dump(dict(b='B'), stream) stream.seek(0) resolver = module.Resolver(stream) self.assertEqual(f._filter_substitute('c', resolver), 'c')
def test_split_append_join(self): f = module.Filter() result = f.apply_all(['split', 'append:0', 'join'], 'a, b, c') self.assertEqual(result, 'a0, b0, c0')
def test_joint(self): f = module.Filter() result = f.apply('join', ['a', 'b', 'c']) self.assertEqual(result, 'a, b, c')
def test_append(self): f = module.Filter() result = f.apply('append:4', '123') self.assertEqual(result, '1234')
def test_split(self): f = module.Filter() result = f.apply('split', 'a, b, c') self.assertListEqual(result, ['a', 'b', 'c'])