def test_handle_value2(self): dic = {'value':'actual'} t = SimpleTemplate('${value}value') m = value_pat.search(t.lines[0]) self.assertIsNotNone(m) cur, o = t.handle_value(m, 0, dic) self.assertEqual(0, cur) self.assertEqual('actualvalue\n', o)
def test_handle_value(self): t = SimpleTemplate('${value}') m = value_pat.search(t.lines[0]) self.assertIsNotNone(m) dict = {'value':'actual'} cur, o = t.handle_value(m, 0, dict) self.assertEqual(0, cur) self.assertEqual('actual\n', o)
def test_value_pat_is_match(self): actual = value_pat.search('${value}') self.assertIsNotNone(actual) self.assertEqual('value', actual.group(1))
def test_value_pat_is_not_match(self): actual = value_pat.search('$') self.assertIsNone(actual)