Пример #1
0
def init():
    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['user_acc'],
            test_parameter['user1_acc']
        ], idlist)
    initdata.clearIMInfo(test_parameter['db'])
    initdata.clearPhoto(test_parameter['db'])
Пример #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_class(self):
     initdata.clearPhoto(test_parameter['db'])
     dbConnect.dbSetting(test_parameter['db'], [
         "update remain_points set remain_points = 15000 where identity_id in( '"
         + idlist[2] + "', '" + idlist[3] + "')",
         "update gift_v2 set is_active = 1, deleted_at is NULL"
     ])
     photo.createPhoto(test_parameter['broadcaster_token'],
                       test_parameter['broadcaster_nonce'],
                       test_parameter['prefix'],
                       photo.createBody(*self.createPhotoList))
     for i in range(2):
         photo.sendPhotoGift(test_parameter['broadcaster_token'],
                             test_parameter['broadcaster_nonce'],
                             test_parameter['prefix'], 1, self.giftId)
     time.sleep(1)
Пример #4
0
 def setup_class(self):
     initdata.clearPhoto(test_parameter['db'])
     for i in range(3):
         body = photo.createBody(self.createPhotoList[i][0],
                                 self.createPhotoList[i][1],
                                 self.createPhotoList[i][2],
                                 self.createPhotoList[i][3],
                                 self.createPhotoList[i][4],
                                 self.createPhotoList[i][5])
         photo.createPhoto(test_parameter['broadcaster_token'],
                           test_parameter['broadcaster_nonce'],
                           test_parameter['prefix'], body)
     res = photo.getPhotoList(test_parameter['broadcaster_token'],
                              test_parameter['broadcaster_nonce'],
                              test_parameter['prefix'], idlist[0], 10, 1)
     restext = json.loads(res.text)
     for i in restext['data']:
         self.photoIdList.append(i['id'])
Пример #5
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)
Пример #6
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('')