Exemple #1
0
def teardown_module():
    changelist = [idlist[0]]
    header['X-Auth-Token'] = test_parameter['backend_token']
    header['X-Auth-Nonce'] = test_parameter['backend_nonce']
    api.changeRole(test_parameter['backend_nonce'],
                   test_parameter['backend_token'],
                   test_parameter['backend_nonce'], changelist, 4)  #轉回直播主
Exemple #2
0
 def setup_method(self):
     changelist = [idlist[0]]
     header['X-Auth-Token'] = test_parameter['backend_token']
     header['X-Auth-Nonce'] = test_parameter['backend_nonce']
     api.changeRole(test_parameter['backend_nonce'],
                    test_parameter['backend_token'],
                    test_parameter['backend_nonce'], changelist, 4)  #轉回直播主
Exemple #3
0
 def setup_class(self):
     api.changeRole(test_parameter['prefix'],
                    test_parameter['backend_token'],
                    test_parameter['backend_nonce'], [idList[0]], 4)
     header['X-Auth-Token'] = test_parameter['broadcaster1_token']
     header['X-Auth-Nonce'] = test_parameter['broadcaster1_nonce']
     api.apiFunction(test_parameter['prefix'], header,
                     '/api/v2/liveMaster/blockUser/' + idList[2], 'delete',
                     None)  #清除黑名單
     header['X-Auth-Token'] = test_parameter['user_token']
     header['X-Auth-Nonce'] = test_parameter['user_nonce']
     urlName = '/api/v2/identity/multipleTrack'
     body = {"data": [idList[0], idList[1]]}
     api.apiFunction(test_parameter['prefix'], header, urlName, 'post',
                     body)
Exemple #4
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)
Exemple #5
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('')