Exemple #1
0
 def test_parseLine_warning_notificationWithWarntype(self):
     #init
     txt = "WARNING: this is a test warning"
     job_name = "testJob"
     build_num = 1
     task_name = "testTask"
     out_expect = '{"build": 1, "job": "testJob", "message": "this is a test warning", "task": "testTask", "type": "WARNING"}'
     #exec
     out = parse_line(txt,job_name,build_num,task_name)
     #eval
     self.assertEqual(out,out_expect,
             "'{0}'!='{1}'".format(out,out_expect))
Exemple #2
0
 def test_parseLine_count_notificationWithCounttype(self):
     #init
     txt = "Error count: 3"
     job_name = "testJob"
     build_num = 1
     task_name = "doesn't matter"
     out_expect = '{"build": 1, "count": 3, "job": "testJob", "type": "ERR_COUNT"}'
     #exec
     out = parse_line(txt,job_name,build_num,task_name)
     #eval
     self.assertEqual(out,out_expect,
             "'{0}'!='{1}'".format(out,out_expect))
Exemple #3
0
 def test_parseLine_empty_empty(self):
     #init
     txt = ""
     job_name = ""
     build_num = 0
     task_name = ""
     out_expect = ""
     #exec
     out = parse_line(txt,job_name,build_num,task_name)
     #eval
     self.assertEqual(out,out_expect,
             "'{0}'!='{1}'".format(out,out_expect))
Exemple #4
0
 def test_parseLine_error_notificationWithErrortype(self):
     #init
     txt = "ERROR: this is a test error"
     job_name = "testJob"
     build_num = 1
     task_name = "testTask"
     out_expect = '{"build": 1, "job": "testJob", "message": "this is a test error", "task": "testTask", "type": "ERROR"}'
     #exec
     out = parse_line(txt,job_name,build_num,task_name)
     #eval
     self.assertEqual(out,out_expect,
             "'{0}'!='{1}'".format(out,out_expect))