Esempio n. 1
0
 def test_ml_failing(self):
     rec = "\n".join(self.should_fail)
     try:
         print("parsed_ml_failing: {}".format(rp.parse(rec)))
         # is this is reach, it parsed something...
         assert False
     except pyparsing.ParseException:
         pass
Esempio n. 2
0
 def test_sl(self):
     for cmd in self.recipe.keys():
         result = rp.parse(cmd)
         if len(result) == 0:
             # comments does not return results
             return
         assert len(result) == 1
         assert cmp_lists(result.pop(), self.recipe[cmd])
Esempio n. 3
0
 def test_ml(self):
     commands = []
     results = []
     for cmd in self.recipe.keys():
         commands.append(cmd)
         results.append(self.recipe[cmd])
     results.reverse()
     parse_results = rp.parse("\n".join(commands))
     for result in parse_results:
         assert cmp_lists(result, results.pop())