def test_data_analysis(self):
     data = []
     for case_id in self.client.get_cases_by_suite("API_Test_Suite_129"):
         data.append(self.client.get_case_by_id(case_id))
     analy = analysis.result_analysis(data=data, exec_time="Sun Oct 25 23:59:25 2015")
     with open(time.strftime("%Y_%m_%d_%H_%M_%S.tmp"), mode="w") as f:
         f.write(analy.data.__str__())
 def test_reporter(self):
     prop = Properties.getProperties()
     prop.set("test.host", "192.168.30.45")
     prop.set("test.port", "38811")
     prop.set("jenkins.port", "8080")
     prop.set("jenkins.host", "192.168.30.45")
     data = []
     for case_id in self.client.get_cases_by_suite("API_Test_Suite_129"):
         data.append(self.client.get_case_by_id(case_id))
     analy = analysis.result_analysis(data=data, exec_time="Sun Oct 25 23:59:25 2015")
     report = Reporter.HtmlReporter(anaylsis=analy, std_out=logging)
     report.save()
 def test_result_analysis(self):
     data = []
     for case_id in self.client.get_cases_by_suite("API_Test_Suite_129"):
         data.append(self.client.get_case_by_id(case_id))
     expect_suite = self.client.get_suite_by_id("API_Test_Suite_129")
     suite_1 = analysis.result_analysis(data=data, exec_time=expect_suite.get("exec_time")).suite
     self.assertDictEqual(
         {"bs": "41/11/0/0", "exec_time": "Sun Oct 25 23:59:25 2015", "partner": "78/0/0/13", "renter": "81/8/1/15"},
         suite_1.content,
     )
     self.assertEqual(248, len(suite_1.cases))
     self.assertEqual("200/19/1/28", suite_1.summary_result())
 def test_result_analysis_2(self):
     data = []
     for case_id in self.client.get_cases_by_suite("API_Test_Suite_129"):
         data.append(self.client.get_case_by_id(case_id))
     analy = analysis.result_analysis(data=data, exec_time="Sun Oct 25 23:59:25 2015")
     self.assertEqual(156, len(analy.req_set))
     for k, v in analy.req_splited_dict.items():
         if k == "partner":
             self.assertEqual(33, len(v))
         if k == "bs":
             self.assertEqual(52, len(v))
         if k == "renter":
             self.assertEqual(71, len(v))
Esempio n. 5
0
 def _analysis(self,data):
     return analysis.result_analysis(data,self.property.get('exec_time'))