def test_channels_list_one_channel(): BF.data['user_info'] = [] BF.data['channel_info'] = [] BF.resetChannel_id() authRegisterDict = BF.user_register('*****@*****.**', '123456', 'real', 'bot') token1 = authRegisterDict['token'] channelsCreateDict = BF.channels_create(token1, 'Channel 1', True) assert BF.channels_list(token1) == { 'channels': [{'channel_id': 1, 'name': 'Channel 1'}] }
def test_channels_list_no_channel2(): BF.data['user_info'] = [] BF.data['channel_info'] = [] BF.resetUser_id() BF.resetChannel_id() authRegisterDict1 = BF.user_register('*****@*****.**', '123456', 'real', 'bot') token1 = authRegisterDict1['token'] authRegisterDict2 = BF.user_register('*****@*****.**', '123456', 'real', 'bot2') token2 = authRegisterDict2['token'] channelsCreateDict = BF.channels_create(token1, 'Channel 1', True) assert BF.channels_list(token2) == {'channels': []}
def test_channels_list_two_channels(): BF.data['user_info'] = [] BF.data['channel_info'] = [] BF.resetUser_id() BF.resetChannel_id() authRegisterDict = BF.user_register('*****@*****.**', '123456', 'real', 'bot') token1 = authRegisterDict['token'] channelsCreateDict1 = BF.channels_create(token1, 'Channel 1', False) channelID1 = channelsCreateDict1['channel_id'] channelsCreateDict2 = BF.channels_create(token1, 'Channel 2', False) channelID2 = channelsCreateDict2['channel_id'] assert BF.channels_list(token1) == { 'channels': [{'channel_id': 1, 'name': 'Channel 1'},{'channel_id': 2, 'name': 'Channel 2'}] }
def test_channels_list_no_channel1(): BF.data['user_info'] = [] BF.data['channel_info'] = [] authRegisterDict = BF.user_register('*****@*****.**', '123456', 'real', 'bot') token1 = authRegisterDict['token'] assert BF.channels_list(token1) == {'channels': []}