def test_parser_libxl_wrong_line(self): wrong = libxl.parse_libxl(self.msg_wrong) # wrong line if 'status' in wrong.keys(): self.fail("Error") else: self.assertTrue(True) # force the green light :-P
def test_parser_libxl(self): compare = (["status", "exists"], ["libname", "libxl"], ["loglevel", "debug"], ["dominf", '10004'], ["d_callback", "libxl.c:1043:domain_death_xswatch_callback"], ["report_name", "shutdown"], ["report_id", "0"]) correct = libxl.parse_libxl(self.msg_correct) # correct line for k, v in compare: if k in correct.keys(): self.assertEqual(correct[k], v) else: self.fail("Key: %s not found" % k)
def test_process_libxl(self): """ I don't have anyway to get something from this method, only test IndexError, ValueError etc. """ correct = libxl.parse_libxl(self.msg_correct) plibxl.process_api(correct)