def test_new_gallery_pictype_check(self): '''验证新color图片类型是否符合请求''' pictype_list = [ "Jigsaw", "Animated", "Special", "Character", "Animal", "Flower", "Places", "Nature", "Message", "Mosaic", "Mandala", "Other" ] self.params['pic_type'] = pictype_list[random.randint( 0, len(pictype_list) - 1)] result = Tool.request_get_result(self.url, self.params) # 断言 self.assertEqual(result['errorCode'], -1) self.assertTrue(Tool.check_pic_type(result['data']['picList'], self.params['pic_type']), msg="{}类型存在异常".format(self.params['pic_type']))
def test_gallery_pictype_check(self): '''验证图片类型是否符合请求''' pictype_list = [ "Jigsaw", "Animated", "Special", "Character", "Animal", "Flower", "Places", "Nature", "Message", "Mosaic", "Mandala", "Other" ] for pictype in pictype_list: self.params['pic_type'] = pictype print(self.params['pic_type']) r = requests.get(self.url, params=self.params) result = r.json() self.assertEqual(result['errorCode'], -1) self.assertTrue(Tool.check_pic_type(result['data']['picList'], self.params['pic_type']), msg="{}类型存在异常".format(self.params['pic_type']))