class Ads(unittest.TestCase): def setUp(self): self.r = FuncRequests() #-----------------启动广告----------参数值:0.5625或0.625------------------------ def testcase_001(self): sheet_index = 10 row = 2 member_id = '744' print("testcase_001广告:") result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") #-----------------轮播图----------参数值:0.5625或0.625------------------------ def testcase_002(self): sheet_index = 10 row = 3 member_id = '744' print("testcase_002轮播图:") result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000")
class Sign(unittest.TestCase): def setUp(self): self.requests = FuncRequests() self.member_id = '959' #-----------------签到 - 添加用户时区【POST】---------------------------------- def testcase_001(self): sheet_index = 0 row = 130 print("testcase_001签到 用户时区-14到+14:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") def testcase_002(self): sheet_index = 0 row = 131 print("testcase_001签到 用户时区外:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10003, result['code']) print("code返回值:10003")
class Ads(unittest.TestCase): def setUp(self): self.r=FuncRequests() #-----------------post广告----------参数值:0.5625或0.625------------------------ def testcase_001(self): sheet_index = 10 row = 1 member_id='none' print ("testcase_001 post广告:") result=self.r.interface_requests(member_id,sheet_index,row) self.assertEqual(10000, result['code']) print("code返回值:10000") #-----------------discover广告----------参数值:0.5625或0.625------------------------ def testcase_002(self): sheet_index = 10 row = 4 member_id='none' print ("testcase_002 discover广告:") result=self.r.interface_requests(member_id,sheet_index,row) self.assertEqual(10000, result['code']) print("code返回值:10000")
class ParticipateComments(unittest.TestCase): def setUp(self): self.member_id = '980' self.requests = FuncRequests() #-----------------评论列表有多个--to -vape_post_comments表 post_publisher 为744--------------------------------- def testcase_001(self): sheet_index =0 row = 60 print("testcase001 评论列表有多个to:") result = self.requests.interface_requests(self.member_id,sheet_index,row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") #-----------------评论列表有多个--from---------------------------------- def testcase_002(self): sheet_index =0 row = 61 print("testcase002 评论列表有多个from:") result = self.requests.interface_requests(self.member_id,sheet_index,row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok")
class System_nation(unittest.TestCase): def setUp(self): self.r = FuncRequests() # -----------------获取开放接口oauth授权认证信息---------------------------------- def testcase_001(self): sheet_index = 3 row = 20 print("testcase_001获取开放接口oauth授权认证信息:") member_id = "745" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000") # -----------------更新开放接口oauth授权认证信息---------------------------------- def testcase_002(self): sheet_index = 3 row = 21 print("testcase_001更新开放接口oauth授权认证信息:") member_id = "745" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000")
class Follow(unittest.TestCase): def setUp(self): self.r = FuncRequests() #-----------------关注、取消关注---------------------------------- def testcase_001(self): sheet_index = 2 row = 1 print("testcase_001关注、取消关注:") member_id = "744" result=self.r.interface_requests(member_id,sheet_index,row) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------用户不存在---------------------------------- def testcase_002(self): sheet_index = 2 row = 2 print("testcase_002用户不存在:") member_id="744" result=self.r.interface_requests(member_id,sheet_index,row) self.assertEqual(10040, result["code"]) print("code返回值:10040")
class RewardsDescription(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------兑换优惠积分不足-------------------------------- def testcase_001(self): sheet_index = 8 row = 6 print("testcase001 兑换优惠积分不足:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10049, result['code']) print("code返回值:10049") self.assertEqual('The card expires.', result['msg']) print("msg返回值:The card expires.") # -----------------用户兑换等级不够-------422等级为最低级------------------------- def testcase_002(self): sheet_index = 8 row = 7 print("testcase002 用户兑换等级不够:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10049, result['code']) print("code返回值:10049") self.assertEqual("The card expires.", result['msg']) print("msg返回值:The card expires.")
class Update_password(unittest.TestCase): def setUp(self): self.member_id = '1455' self.requests = FuncRequests() # -----------------用户修改密码---------------------------------- def testcase_001(self): sheet_index = 0 row = 99 print("testcase_001修改密码111111改为222222:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") def testcase_002(self): sheet_index = 0 row = 100 print("testcase_002密码改回222222改为111111:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok")
class Shop(unittest.TestCase): def setUp(self): self.r=FuncRequests() #-----------------关注店铺---------------------------------- def testcase_001(self): sheet_index = 12 row = 19 member_id='744' print ("testcase_001关注店铺:") result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") #-----------------取消关注店铺---------------------------------- def testcase_002(self): sheet_index = 12 row = 20 member_id='744' print ("testcase_002取消关注店铺:") result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000")
class Passport_Login(unittest.TestCase): def setUp(self): self.r = FuncRequests() #----------------- 检测第三方已注册---------------------------------- #-----------------facebook:411568645883504 twitter:861855853032357889 vk:427871220-------------------------- def testcase_001(self): sheet_index = 6 row = 1 print("testcase_001检测第三方已注册:") member_id = 'none' result = self.r.interface_requests(member_id, sheet_index, row) data = result['data'] self.assertEqual(10000, result["code"]) print("code返回值:10000") self.assertEqual(1, len(data["list"])) print("推荐的用户昵称等于1,表示已经注册") #----------------- 检测第三方未注册---------------------------------- #-----------------facebook:411568645883504 twitter:861855853032357889 vk:427871220-------------------------- def testcase_002(self): sheet_index = 6 row = 2 print("testcase_001检测第三方未注册:") member_id = 'none' result = self.r.interface_requests(member_id, sheet_index, row) data = result["data"] self.assertEqual(10000, result["code"]) print("code返回值:10000") self.assertEqual(5, len(data["list"])) print("推荐的用户昵称不等于1,表示未注册")
class VerifyCode(unittest.TestCase): def setUp(self): self.member_id = '760' self.requests = FuncRequests() #-----------------发送验证link至邮箱---------------------------------- def testcase_001(self): sheet_index = 0 row = 43 print("testcase001发送验证link至邮箱:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") # -----------------邮箱格式不正确---------------------------------- def testcase_002(self): sheet_index = 0 row = 44 print("testcase002邮箱格式不正确:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10003, result['code']) print("code返回值:10003") self.assertEqual('Parameter Error', result['msg']) print("msg返回值:Parameter Error.")
class ParticipateAttention(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------用户被@的数据post ---------------------------------- def testcase_001(self): sheet_index = 0 row = 62 print("testcase001 用户被@的数据post:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") #-----------------用户被@的数据comment---------------------------------- def testcase_002(self): sheet_index = 0 row = 63 print("testcase002 用户被@的数据comment:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok")
class CommentsPublish(unittest.TestCase): def setUp(self): self.r = FuncRequests() #-----------------首页news列表第一页数据---------------------------------- def testcase_001(self): sheet_index = 1 row = 90 print("testcase_001 首页news列表第一页数据:") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) list = result['data']['list'] global last_id last_id = list[9]['post_id'] print(last_id) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------首页news列表第二页数据---------------------------------- def testcase_002(self): sheet_index = 1 row = 91 print("testcase_002 首页news列表第二页数据:") member_id = "744" payload = {"category": "all", "last_id": last_id} result = self.r.interface_requests_payload(member_id, sheet_index, row, payload) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------用户中心的review列表第一页数据---------------------------------- def testcase_003(self): sheet_index = 1 row = 92 print("testcase_003 用户中心的review列表第一页数据:") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) post_list = result['data']['list'] #-----------------用户中心的review列表第二页数据---------------------------------- def testcase_004(self): sheet_index = 1 row = 93 print("testcase_004 用户中心的review列表第二页数据:") member_id = "744" payload = {"category": "mine", "last_id": 12451} result = self.r.interface_requests_payload(member_id, sheet_index, row, payload) self.assertEqual(10000, result["code"]) print("code返回值:10000")
class List(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------用户个人post列表 all---------------------------------- def testcase_001(self): sheet_index = 0 row = 71 print("testcase001 用户个人post列表 all:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") #-----------------用户个人post列表第2页数据---------------------------------- def testcase_002(self): urlpart = "/member/posts" payload = {"page": "1", "type": "all", "member_id": "744"} result = self.requests.interface_requests_data(self.member_id, urlpart, payload) #先获取第一页最后一条post的post_id date = result['data']['list'] post_id = date[9]['post_id'] #原地址+当前接口地址拼接 payload = { "page": "2", "type": "all", "member_id": "744", "last_id": post_id } sheet_index = 0 row = 72 print("testcase002 用户个人post列表第2页数据:") result = self.requests.interface_requests_payload( self.member_id, sheet_index, row, payload) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") # -----------------type不存在---------------------------------- def testcase_003(self): sheet_index = 0 row = 74 print("testcase003 type不存在:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(9999, result['code']) print("code返回值:9999") self.assertEqual('Time out.', result['msg']) print("msg返回值:Time out.")
class CommentsDel(unittest.TestCase): def setUp(self): self.r = FuncRequests() #-----------------删除自己的评论---------------------------------- def testcase_001(self): sheet_index = 1 row = 24 print("testcase_001删除评论:") #1.调用发布接口发送一条动态,获取post_id date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) payload1 = {"uid": "744", "content": "接口在" + date + "测试发布纯文字"} member_id = "744" urlpart1 = '/posts/publish' result1 = self.r.interface_requests_data(member_id, urlpart1, payload1) post_id=result1["data"]["post_id"] # 2.调用评论接口,获得comment_id date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) payload2 = {"post_id": post_id, "content": "接口在" + date + "测试发布评论", "is_post": "N"} urlpart2 = '/comments/publish' result2 = self.r.interface_requests_data(member_id, urlpart2, payload2) comment_id = result2["data"]["comment_id"] print(comment_id) # 获取删除评论接口的token值 payload = {"comment_id": comment_id} result=self.r.interface_requests_payload(member_id, sheet_index, row, payload) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------删除别人的评论---------------------------------- def testcase_002(self): sheet_index = 1 row = 25 print("testcase_002删除别人的评论:") member_id = "744" result=self.r.interface_requests(member_id,sheet_index,row) self.assertEqual(10003, result["code"]) print("code返回值:10003") #-----------------删除不存在的评论---------------------------------- def testcase_003(self): sheet_index=1 row=26 print("testcase_003删除不存在的评论:") member_id = "744" result=self.r.interface_requests(member_id,sheet_index,row) self.assertEqual(10003, result["code"]) print("code返回值:10003")
class Language(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------语言设置english---------------------------------- def testcase_001(self): sheet_index = 0 row = 55 print("testcase001语言设置english:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") #-----------------语言设置russian---------------------------------- def testcase_002(self): sheet_index = 0 row = 56 print("testcase002语言设置russian:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") # -----------------language 为数字---------------------------------- def testcase_003(self): sheet_index = 0 row = 57 print("testcase003 language 为数字:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(9999, result['code']) print("code返回值:9999") self.assertEqual('Time out.', result['msg']) print("msg返回值:Time out.") # -----------------language为特殊字符---------------------------------- def testcase_004(self): sheet_index = 0 row = 58 print("testcase004 language为特殊字符:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(9999, result['code']) print("code返回值:9999") self.assertEqual('Time out.', result['msg']) print("msg返回值:Time out.")
class Post_share(unittest.TestCase): def setUp(self): self.r = FuncRequests() #-----------------第三方分享回调---------------------------------- #-----------------facebook:411568645883504 twitter:861855853032357889 vk:427871220-------------------------- def testcase_001(self): sheet_index = 6 row = 7 print("testcase_001第三方分享回调") # 调用发布接口发送一条动态,获取post_id date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) payload1 = {"content": "接口在" + date + "测试发布纯文字"} member_id = "744" urlpart1 = '/posts/publish' result1 = self.r.interface_requests_data(member_id, urlpart1, payload1) post_id = result1["data"]["post_id"] print(post_id) #调用第三方分享回调接口 payload = {'platform': 'facebook', 'post_id': post_id} result = self.r.interface_requests_payload(member_id, sheet_index, row, payload) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------不支持的第三方---------------------------------- #-----------------facebook:411568645883504 twitter:861855853032357889 vk:427871220-------------------------- def testcase_002(self): sheet_index = 6 row = 8 print("testcase_002不支持的第三方") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------分享app---------------------------------- #-----------------facebook:411568645883504 twitter:861855853032357889 vk:427871220-------------------------- def testcase_003(self): sheet_index = 6 row = 9 print("testcase_003分享app:") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000")
class Sign(unittest.TestCase): def setUp(self): self.requests = FuncRequests () #-----------------签到 - 用户签到 ---------------------------------- def testcase_001(self): #-----用户注册----- self.member_id = 'none' self.requests = FuncRequests () sheet_index = 0 row = 12 print ( "testcase001 用户注册成功:" ) nowTime = time.strftime ( "%Y%m%d_%H_%M_%S" ) nickname = 'heyu' + nowTime email = 'heyu' + nowTime + '@qq.com' print ( email ) payload = {'email': email, 'password': '******', 'displayname': 'heyu', 'nickname': nickname, 'equipment_number': 'PE-TL10', } result = self.requests.interface_requests_payload ( self.member_id, sheet_index, row, payload ) print(result) self.member_id = str(result['data']['member_id']) sheet_index = 0 row = 136 print("testcase_001签到 用户签到:") result = self.requests.interface_requests(self.member_id,sheet_index,row) self.assertEqual(10000, result['code']) print("code返回值:10000")
class Passport_Login(unittest.TestCase): def setUp(self): self.r = FuncRequests() # -----------------搜索post数据---------------------------------- def testcase_001(self): sheet_index = 9 row = 7 print("testcase_001搜索post数据:") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000") # -----------------搜索reveal数据---------------------------------- def testcase_002(self): sheet_index = 9 row = 8 print("testcase_002搜索reveal数据:") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000") # -----------------搜索people数据--------------------------------- def testcase_003(self): sheet_index = 9 row = 9 print("testcase_003搜索people数据:") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000") # -----------------hotnews--------------------------------- def testcase_006(self): sheet_index = 9 row = 10 print("testcase_006搜索hotnews数据:") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000")
class MemberCenter(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------查看当前用户信息---------------------------------- def testcase_001(self): sheet_index = 0 row = 30 print("testcase001查看当前用户信息:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------查看其他用户信息---------------------------------- def testcase_002(self): sheet_index = 0 row = 31 print("testcase002查看其他用户信息:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------member_id为空---------------------------------- def testcase_003(self): sheet_index = 0 row = 32 print("testcase003 member_id为空:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10040, result["code"]) print("code返回值:10040") print("msg返回值:This user does not exist.") #-----------------member_id不存在---------------------------------- def testcase_004(self): sheet_index = 0 row = 33 print("testcase004 member_id不存在:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10040, result["code"]) print("code返回值:10040") print("msg返回值:This user does not exist.")
class PostsDetail(unittest.TestCase): def setUp(self): self.r = FuncRequests() #-----------------删除自己的动态---------------------------------- def testcase_001(self): sheet_index = 1 row = 21 print("testcase_001动态删除:") #调用发布接口发送一条动态,获取post_id date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) payload1 = {"uid": "744", "content": "接口在" + date + "测试发布纯文字"} # 获取发布接口token值 member_id = "744" urlpart1 = '/posts/publish' result1 = self.r.interface_requests_data(member_id, urlpart1, payload1) post_id = result1["data"]["post_id"] payload = {"post_id": post_id} result = self.r.interface_requests_payload(member_id, sheet_index, row, payload) self.assertEqual(10000, result["code"]) print("code返回值:10000") #-----------------删除别人的动态---------------------------------- def testcase_002(self): sheet_index = 1 row = 22 print("testcase_002删除别人的动态:") # 调用发布接口发送一条动态,获取post_id date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) payload1 = {"uid": "744", "content": "接口在" + date + "测试发布纯文字"} member_id = "744" urlpart1 = '/posts/publish' result1 = self.r.interface_requests_data(member_id, urlpart1, payload1) post_id = result1["data"]["post_id"] payload = {"post_id": post_id} # 获取token值 member_id = "748" result = self.r.interface_requests_payload(member_id, sheet_index, row, payload) self.assertEqual(10003, result["code"]) print("code返回值:10003") #-----------------删除不存在的动态---------------------------------- def testcase_003(self): sheet_index = 1 row = 23 print("testcase_003删除不存在的动态:") member_id = "744" result = self.r.interface_requests(member_id, sheet_index, row) self.assertEqual(9999, result["code"]) print("code返回值:9999")
class ChangeEmail(unittest.TestCase): def setUp(self): self.member_id = '760' self.requests = FuncRequests() #-----------------修改用户邮箱成功---------------------------------- def testcase_001(self): sheet_index = 0 row = 40 print("testcase001 修改用户邮箱成功:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") #-----------------修改为已存在的用户邮箱---------------------------------- def testcase_002(self): sheet_index = 0 row = 41 print("testcase002 修改为已存在的用户邮箱:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10002, result['code']) print("code返回值:10002") self.assertEqual('The email address has been taken.', result['msg']) print("msg返回值:The email address has been taken.") #-----------------修改的邮箱格式不正确---------------------------------- def testcase_003(self): sheet_index = 0 row = 42 print("testcase003 修改的邮箱格式不正确:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(9999, result['code']) print("code返回值:9999") self.assertEqual('Time out.', result['msg']) print("msg返回值:Time out.")
class Sound(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------开声音---------------------------------- def testcase_001(self): sheet_index = 0 row = 52 print("testcase001开声音:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") # -----------------sound字段为数字+字母---------------------------------- def testcase_002(self): sheet_index = 0 row = 53 print("testcase002 sound字段为数字+字母:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(9999, result['code']) print("code返回值:9999") self.assertEqual('Time out.', result['msg']) print("msg返回值:Time out.") # -----------------sound字段为特殊字符---------------------------------- def testcase_003(self): sheet_index = 0 row = 54 print("testcase003 sound字段为特殊字符:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(9999, result['code']) print("code返回值:9999") self.assertEqual('Time out.', result['msg']) print("msg返回值:Time out.")
class List(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------用户喜欢的post列表 all---vape_post_praise表------------------------------- def testcase_001(self): sheet_index = 0 row = 75 print("testcase001 用户喜欢的post列表:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") # -----------------用户喜欢的post列表 photo---------------------------------- def testcase_002(self): sheet_index = 0 row = 76 print("testcase002 用户喜欢的post列表 photo:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") # -----------------用户喜欢的post列表 video---------------------------------- def testcase_003(self): sheet_index = 0 row = 77 print("testcase003 用户喜欢的post列表 video:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok")
class RewardsDescription(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------积分流水记录-all--------------------------------- def testcase_001(self): sheet_index =8 row = 3 print("testcase001 积分流水记录-all:") result = self.requests.interface_requests(self.member_id,sheet_index,row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") #-----------------积分流水记录-add--------------------------------- def testcase_002(self): sheet_index =8 row = 4 print("testcase002 积分流水记录-add:") result = self.requests.interface_requests(self.member_id,sheet_index,row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok") #-----------------积分流水记录-reduce--------------------------------- def testcase_003(self): sheet_index =8 row = 5 print("testcase003 积分流水记录-reduce:") result = self.requests.interface_requests(self.member_id,sheet_index,row) self.assertEqual(10000, result['code']) print("code返回值:10000") self.assertEqual('', result['msg']) print("msg返回值:ok")
class Brands(unittest.TestCase): def setUp(self): self.r = FuncRequests() self.member_id = '10394' #-----------------钱包 - 账户余额\冻结余额\可用额度---------------------------------- def testcase_001(self): sheet_index = 13 row = 2 print("testcase_001钱包 - 账户余额\冻结余额\可用额度:") result = self.r.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000")
class Brands(unittest.TestCase): def setUp(self): self.r = FuncRequests() self.member_id = '744' #-----------------判断用户是否可以发布评测post---------------------------------- def testcase_001(self): sheet_index = 0 row = 107 print("testcase_001判断用户是否可以发布评测post:") result = self.r.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000")
class Brands(unittest.TestCase): def setUp(self): self.r = FuncRequests() self.member_id = '10394' #-----------------钱包 - 已获得奖励第一页数据----------------------------------269006409 def testcase_001(self): sheet_index = 13 row = 3 print("testcase_001钱包 - 已获得奖励第一页数据:") result = self.r.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000")
class Brands(unittest.TestCase): def setUp(self): self.r = FuncRequests() self.member_id = '744' #-----------------获取收货地址(默认)---------------------------------- def testcase_001(self): sheet_index = 0 row = 105 print("testcase_001获取收货地址(默认):") result = self.r.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000") #-----------------获取收货地址(所有)---------------------------------- def testcase_002(self): sheet_index = 0 row = 106 print("testcase_001获取收货地址(所有):") result = self.r.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000")
class Discover(unittest.TestCase): def setUp(self): self.member_id = '744' self.requests = FuncRequests() #-----------------发现首页部分同设备用户---------------------------------- def testcase_001(self): sheet_index = 4 row = 3 print("testcase001 发现首页部分同设备用户:") result = self.requests.interface_requests(self.member_id, sheet_index, row) self.assertEqual(10000, result['code']) print("code返回值:10000")