예제 #1
0
 def test_retrieve_command_as_list(self):
     template = "{/timers/@text} {/@text}"
     path = '/protocols/ospf/freq'
     syntax = {path: template}
     v = VyattaJSONParser({}, syntax)
     actual = list(v.retrieve_commands(path))
     expected = [template]
     self.assertEqual(actual, expected)
예제 #2
0
 def test_retrieve_command_escape_dots(self):
     template = "{/../timers/@text}"
     path = '/protocols/ospf/freq'
     syntax = {path: template}
     v = VyattaJSONParser({}, syntax)
     actual = list(v.retrieve_commands(path))
     expected = ["{{/{}/timers/@text}}".format(DIR_TRAVERSE_UP_LABEL)]
     self.assertEqual(actual, expected)