Beispiel #1
0
 def test_gift_15(self):
     '''业务-粉丝值'''
     self.exp_res = {'status': True, 'code': 200, 'data': {}}
     self.user = self.create_user()
     MoneyClass.set_money(self.user, 1)
     get_loveliness = User.loveliness('get', self.user, cid)
     self.ver = lambda: User.loveliness(
         'get', self.user, cid) == get_loveliness + gift['fan_exp']
Beispiel #2
0
    26: [220000000, 100, 280000],
    27: [310000000, 100, 360000],
    28: [420000000, 100, 440000],
    29: [550000000, 100, 520000],
    30: [700000000, 100, 600000],
}

uids = list(range(5524, 5554))

# 测试各等级每日礼包
for i in fans_config.keys():
    # 创建用户
    uid = User.reg('fans')
    # uid = uids[i-1]
    # 设置粉丝值
    User.loveliness('set', uid, 2, fans_config[i][0])
    # 判断等级,每日礼包数量
    ret = requests.post('http://lxy.new.huomaotv.com.cn/chatnew/joinMsg',
                        data=dict(cid=2, anchor_id=1522, is_yule=0),
                        cookies=Common.generate_cookies(uid)).json()
    if int(ret['data']['fans']['level']) == i and Bag.get_bag(
            uid, 20) == fans_config[i][1]:
        print(uid, int(ret['data']['fans']['level']), i, Bag.get_bag(uid, 20),
              fans_config[i][1], '测试ok')
    else:
        print(uid, int(ret['data']['fans']['level']), i, Bag.get_bag(uid, 20),
              fans_config[i][1], '测试fail')
    # 测试衰减脚本
    requests.get('http://lxy.new.huomaotv.com.cn/crontab/fansAttenuation')
    scores = User.loveliness('get', uid, 2)
    if scores == fans_config[i][0] - fans_config[i][2]: