Пример #1
0
def setup_module():
    Auth = []
    initdata.set_test_data(env, test_parameter)
    initdata.initIdList(
        test_parameter['prefix'], test_parameter['backend_token'],
        test_parameter['backend_nonce'], [
            test_parameter['broadcaster_acc'], test_parameter['backend_acc'],
            test_parameter['liveController1_acc'], test_parameter['user_acc'],
            test_parameter['user1_acc']
        ], idList)
    initdata.clearFansInfo(test_parameter['db'])
    initdata.clearIMInfo(test_parameter['db'])
    Auth.extend([
        test_parameter['backend_token'], test_parameter['backend_nonce'],
        test_parameter['liveController1_token'],
        test_parameter['liveController1_nonce']
    ])
    for i in range(2):
        header['X-Auth-Token'] = Auth[i * 2]
        header['X-Auth-Nonce'] = Auth[i * 2 + 1]
        createMessage(idList[0], idList[i + 1], header, 'text',
                      '哈囉,你好。這裡是Truelove客服。我們仍在處理中,請再等一下 ', '', '', '')
        createMessage(idList[3], idList[i + 1], header, 'text',
                      '哈囉,你好。這裡是Truelove客服。我們仍在處理中,請再等一下 ', '', '', '')
        time.sleep(0.5)
        createMessage(idList[0], idList[i + 1], header, 'video', '', '',
                      test_parameter['preview_url'],
                      test_parameter['video_url'])
        createMessage(idList[3], idList[i + 1], header, 'video', '', '',
                      test_parameter['preview_url'],
                      test_parameter['video_url'])
Пример #2
0
def setup_module():
    initdata.set_test_data(env, test_parameter)
    initdata.clearFansInfo(test_parameter['db'])
    initdata.clearPhoto(test_parameter['db'])
    initdata.clearNotiySetting(test_parameter['db'])
    initdata.initIdList(
        test_parameter['prefix'], test_parameter['backend_token'],
        test_parameter['backend_nonce'], [
            test_parameter['broadcaster_acc'], test_parameter['user_acc'],
            test_parameter['user1_acc']
        ], idList)
Пример #3
0
def setup_module():
    initdata.set_test_data(env, test_parameter)
    initdata.initIdList(
        test_parameter['prefix'], test_parameter['backend_token'],
        test_parameter['backend_nonce'], [
            test_parameter['broadcaster_acc'],
            test_parameter['broadcaster1_acc'], test_parameter['backend_acc'],
            test_parameter['user_acc'], test_parameter['user1_acc']
        ], idList)
    initdata.clearFansInfo(test_parameter['db'])
    sqlList = ["insert into zego_master values ('" + idList[0] + "')"]
    dbConnect.dbSetting(test_parameter['db'], sqlList)
Пример #4
0
def setup_module():
    initdata.set_test_data(env, test_parameter)
    initdata.clearFansInfo(test_parameter['db'])
    initdata.initIdList(
        test_parameter['prefix'], test_parameter['backend_token'],
        test_parameter['backend_nonce'], [
            test_parameter['broadcaster_acc'],
            test_parameter['broadcaster1_acc'], test_parameter['user_acc'],
            test_parameter['user1_acc']
        ], idlist)
    sqlList = [
        "update gift_v2 set deleted_at = NULL, is_active = 1 where uuid = '234df236-8826-4938-8340-32f39df43ed1'"
    ]
    dbConnect.dbSetting(test_parameter['db'], sqlList)
Пример #5
0
def setup_module():
    initdata.set_test_data(env, test_parameter)
    initdata.clearConsumption(test_parameter['db'])
    initdata.clearIdentityData(test_parameter['db'])
    initdata.clearFansInfo(test_parameter['db'])
    initdata.initIdList(test_parameter['prefix'], test_parameter['backend_token'], test_parameter['backend_nonce'], [test_parameter['broadcaster_acc'],
    test_parameter['broadcaster1_acc'], test_parameter['user_acc'], test_parameter['user1_acc'], 'liveAcc0004'], idList)
    header['X-Auth-Nonce'] = test_parameter['user_nonce']
    header['X-Auth-Token'] = test_parameter['user_token']
    api.set_tracking(test_parameter['prefix'], header, 'post', idList[4])
    res = liveAcc0004Login()
    restext = json.loads(res.text)
    header['X-Auth-Nonce'] = restext['data']['nonce']
    header['X-Auth-Token'] = restext['data']['token']
    api.set_tracking(test_parameter['prefix'], header, 'post', idList[0])
    idList.append(createAccountByEmail())
    idList.append(loginByLine())
    initVerifyData()
Пример #6
0
def testInit():
    createPhotoList = [
        [
            'photo',
            'https://d3eq1e23ftm9f0.cloudfront.net/story/photo/6e7103c048cd11ea83b942010a8c0017.png',
            '動態照片上傳', '', '', '108'
        ],
        [
            '',
            'https://d3eq1e23ftm9f0.cloudfront.net/story/photo/6e7103c048cd11ea83b942010a8c0017.png',
            '動態照片上傳,未設type跟gift category', '', '', ''
        ],
        [
            'video', '', '動態影片上傳',
            'https://d3eq1e23ftm9f0.cloudfront.net/story/photo/096ee460b45c11eab2d142010a8c0017.png',
            'https://d3eq1e23ftm9f0.cloudfront.net/story/vedio/ef79cfbab45c11eab2d142010a8c0017.mp4',
            '108'
        ]
    ]
    initdata.clearFansInfo(test_parameter['db'])
    initdata.clearPhoto(test_parameter['db'])
    api.changeRole(test_parameter['prefix'], test_parameter['backend_token'],
                   test_parameter['backend_nonce'], [idList[0], idList[1]], 4)
    header['X-Auth-Token'] = test_parameter['user_token']
    header['X-Auth-Nonce'] = test_parameter['user_nonce']
    urlName = '/api/v2/identity/track'
    for i in range(2):
        body = {"liveMasterId": idList[i]}
        api.apiFunction(test_parameter['prefix'], header, urlName, 'post',
                        body)
        time.sleep(1.5)
    array1 = [
        'broadcaster_token', 'broadcaster_nonce', 'broadcaster1_token',
        'broadcaster1_nonce'
    ]
    for i in range(2):
        for j in range(2):
            body = photo.createBody(*createPhotoList[j])
            photo.createPhoto(test_parameter[array1[i * 2]],
                              test_parameter[array1[i * 2 + 1]],
                              test_parameter['prefix'], body)
    time.sleep(5)
Пример #7
0
def setup_module():
    initdata.set_test_data(env, test_parameter)
    initdata.clearFansInfo(test_parameter['db'])
    initdata.clearPhoto(test_parameter['db'])
    initdata.initIdList(
        test_parameter['prefix'], test_parameter['backend_token'],
        test_parameter['backend_nonce'], [
            test_parameter['broadcaster_acc'],
            test_parameter['broadcaster1_acc'], test_parameter['user_acc'],
            test_parameter['user1_acc']
        ], idList)
    header['X-Auth-Token'] = test_parameter['backend_token']
    header['X-Auth-Nonce'] = test_parameter['backend_nonce']
    for i in range(10):
        liveMasterList.append(
            api.search_user(test_parameter['prefix'], 'broadcaster01' + str(i),
                            header))
    api.changeRole(test_parameter['prefix'], test_parameter['backend_token'],
                   test_parameter['backend_nonce'], liveMasterList, 4)
    liveMasterList.append('')
Пример #8
0
def setup_module():
    sqlList = []
    create_At = int((datetime.today() - timedelta(hours=8)).strftime('%s'))
    initdata.set_test_data(env, test_parameter)
    initdata.clearFansInfo(test_parameter['db'])
    initdata.clearLiveData(test_parameter['db'])
    initdata.initIdList(
        test_parameter['prefix'], test_parameter['backend_token'],
        test_parameter['backend_nonce'], [
            test_parameter['broadcaster_acc'],
            test_parameter['broadcaster1_acc'], test_parameter['user_acc'],
            test_parameter['user1_acc']
        ], idlist)
    for i in range(2):
        sqlStr = "insert into zego_master values('" + idlist[i] + "')"
        sqlList.append(sqlStr)
    sqlStr = "insert into top_sort values('" + idlist[
        0] + "', FROM_UNIXTIME(" + str(create_At)
    sqlStr += ", '%Y-%m-%d %H:%i:%s'), 'lisa', FROM_UNIXTIME(" + str(
        create_At) + ", '%Y-%m-%d %H:%i:%s'), 'lisa', 3, 0)"
    sqlList.append(sqlStr)
    dbConnect.dbSetting(test_parameter['db'], sqlList)
Пример #9
0
 def setup_class(self):
     initdata.clearFansInfo(test_parameter['db'])