Пример #1
0
 def test_res_history_aggr_query_14(self):
     """测试请求参数不传startIndex、size、aggrType"""
     result = res_history_aggr_query(subjectId_Gary, attrs, dimensionType, startTime, endTime,
                                     startIndex=None, size=None, aggrType=None)
     self.assertIn('"code":0', result.text)
Пример #2
0
 def test_res_history_aggr_query_09(self):
     """测试开始时间等于结束时间"""
     result = res_history_aggr_query(subjectId_Gary, attrs, dimensionType, startTime, startTime,
                                     startIndex, size, aggrType)
     self.assertIn('"code":0', result.text)
Пример #3
0
 def test_res_history_aggr_query_10(self):
     """测试开始时间大于结束时间"""
     result = res_history_aggr_query(subjectId_Gary, attrs, dimensionType, startTime.replace("1", "2"), startTime,
                                     startIndex, size, aggrType)
     self.assertIn('"code":729', result.text)
Пример #4
0
 def test_res_history_aggr_query_05(self):
     """测试设备资源属性值attr为空"""
     result = res_history_aggr_query(subjectId_Gary, "", dimensionType, startTime, endTime,
                                     startIndex, size, aggrType)
     self.assertIn('"code":0', result.text)
Пример #5
0
 def test_res_history_aggr_query_08(self):
     """测试endTime为空"""
     result = res_history_aggr_query(subjectId_Gary, attrs, dimensionType, startTime, "",
                                     startIndex, size, aggrType)
     self.assertIn('"code":728', result.text)
Пример #6
0
 def test_res_history_aggr_query_04(self):
     """测试查询对象id为空"""
     result = res_history_aggr_query("", attrs, dimensionType, startTime, endTime,
                                     startIndex, size, aggrType)
     self.assertIn('"code":302', result.text)
Пример #7
0
 def test_res_history_aggr_query_03(self):
     """测试查询其他人的对象id"""
     result = res_history_aggr_query(subjectId_Jenny, attrs, dimensionType, startTime, endTime,
                                     startIndex, size, aggrType)
     self.assertIn('"code":706', result.text)
Пример #8
0
 def test_res_history_aggr_query_02(self):
     """测试查询Id错误或不存在"""
     result = res_history_aggr_query(subjectId_wrong, attrs, dimensionType, startTime, endTime,
                                     startIndex, size, aggrType)
     self.assertIn('"code":706', result.text)
Пример #9
0
 def test_res_history_aggr_query_01(self):
     """测试资源历史聚合结果查询"""
     result = res_history_aggr_query(subjectId_Gary, attrs, dimensionType, startTime, endTime,
                                     startIndex, size, aggrType)
     self.assertIn('"code":0', result.text)
Пример #10
0
 def test_res_history_aggr_query_16(self):
     """测试size为1"""
     result = res_history_aggr_query(subjectId_Gary, attrs, dimensionType, startTime, endTime,
                                     startIndex, size=1, aggrType=aggrType)
     self.assertIn('"code":0', result.text)