Пример #1
0
 def test_res_history_aggr_query_new_09(self):
     """测试开始时间等于结束时间"""
     result = res_history_aggr_query_new(subjectId_Gary, attrs,
                                         dimensionType, startTime,
                                         startTime, startIndex, size,
                                         aggrType)
     self.assertIn('"code":0', result.text)
Пример #2
0
 def test_res_history_aggr_query_new_10(self):
     """测试开始时间大于结束时间"""
     result = res_history_aggr_query_new(subjectId_Gary, attrs,
                                         dimensionType,
                                         startTime.replace("1",
                                                           "2"), startTime,
                                         startIndex, size, aggrType)
     self.assertIn('"code":729', result.text)
Пример #3
0
 def test_res_history_aggr_query_new_11(self):
     """测试请求参数不传startIndex"""
     result = res_history_aggr_query_new(subjectId_Gary,
                                         attrs,
                                         dimensionType,
                                         startTime,
                                         endTime,
                                         startIndex=None,
                                         size=size,
                                         aggrType=aggrType)
     self.assertIn('"code":0', result.text)
Пример #4
0
 def test_res_history_aggr_query_new_16(self):
     """测试size为1"""
     result = res_history_aggr_query_new(subjectId_Gary,
                                         attrs,
                                         dimensionType,
                                         startTime,
                                         endTime,
                                         startIndex,
                                         size=1,
                                         aggrType=aggrType)
     self.assertIn('"code":0', result.text)
Пример #5
0
 def test_res_history_aggr_query_new_08(self):
     """测试endTime为空"""
     result = res_history_aggr_query_new(subjectId_Gary, attrs,
                                         dimensionType, startTime, "",
                                         startIndex, size, aggrType)
     self.assertIn('"code":728', result.text)
Пример #6
0
 def test_res_history_aggr_query_new_05(self):
     """测试设备资源属性值attr为空"""
     result = res_history_aggr_query_new(subjectId_Gary, "", dimensionType,
                                         startTime, endTime, startIndex,
                                         size, aggrType)
     self.assertIn('"code":0', result.text)
Пример #7
0
 def test_res_history_aggr_query_new_04(self):
     """测试查询对象id为空"""
     result = res_history_aggr_query_new("", attrs, dimensionType,
                                         startTime, endTime, startIndex,
                                         size, aggrType)
     self.assertIn('"code":302', result.text)
Пример #8
0
 def test_res_history_aggr_query_new_03(self):
     """测试查询其他人的对象id"""
     result = res_history_aggr_query_new(subjectId_Jenny, attrs,
                                         dimensionType, startTime, endTime,
                                         startIndex, size, aggrType)
     self.assertIn('"code":706', result.text)
Пример #9
0
 def test_res_history_aggr_query_new_02(self):
     """测试查询Id错误或不存在"""
     result = res_history_aggr_query_new(subjectId_wrong, attrs,
                                         dimensionType, startTime, endTime,
                                         startIndex, size, aggrType)
     self.assertIn('"code":706', result.text)