def test_set_standUp_not_login(): token = A['token'] auth_logout(token) channel_id = Pub_channel['channel_id'] with pytest.raises(OF.AccessError): OF.standup_active(token, channel_id)
def test_delete_logout(): token = A['token'] auth_logout(token) channelID = Pub_channel['channel_id'] with pytest.raises(CF.AccessError): CF.channel_delete(token, channelID)
def test_user_NotLogin(): token = A['token'] auth_logout(token) u_id = A['u_id'] with pytest.raises(UF.AccessError): UF.user_profile(token, u_id)
def test_leave_notLogin(): token = A['token'] auth_logout(token) channelID = Pub_channel['channel_id'] with pytest.raises(CF.AccessError): CF.channel_join(token, channelID)
def test_changeName_logout(): token = O['token'] auth_logout(token) channelID = Pub_channel['channel_id'] with pytest.raises(CF.AccessError): CF.channel_name_change(token, channelID, 'name')
def test_notLogin_invite(): token = A['token'] auth_logout(token) u_id = B['u_id'] channelID = Pub_channel['channel_id'] with pytest.raises(CF.AccessError): CF.channel_invite(token,channelID, u_id)
def test_user_NOTLOGIN(): token = A['token'] auth_logout(token) channelID = Pub_channel['channel_id'] u_id = B['u_id'] with pytest.raises(CF.AccessError): CF.channel_addowner(token, channelID, u_id)
def test_user_not_login(): reset_data() A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning") token = A['token'] auth_logout(token) with pytest.raises(UF.AccessError): UF.users_all(token)
def test_user_name_Notlogin(): token = A['token'] auth_logout(token) name_first = 'Hello' name_last = 'World' with pytest.raises(UF.AccessError): UF.user_setname(token, name_first, name_last)
def test_user_setHand_NotLogin(): reset_data() A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning") token = A['token'] auth_logout(token) handle = 'GoodMorning' with pytest.raises(UF.AccessError): UF.user_profile_sethandle(token, handle)
def test_user_delete_notLogin(): reset_data() A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee") token = A['token'] auth_logout(token) password = '******' with pytest.raises(UF.AccessError): UF.user_profile_delete(token, password)
def test_standUp_logout(): token = A['token'] auth_logout(A['token']) channelID = Pub_channel['channel_id'] length = '15' with pytest.raises(OF.AccessError): OF.standup_start(token, channelID, length)
def test_reomveOwner_login(): token = A['token'] auth_logout(token) u_id = B['u_id'] channelID = Pub_channel['channel_id'] with pytest.raises(CF.AccessError): CF.channel_removeowner(token, channelID, u_id)
def test_not_loggedIn(): reset_data() A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee") Pub_channel = CF.channels_create(A['token'], 'NextChannel', 'True') token = A['token'] auth_logout(token) channelID = Pub_channel['channel_id'] with pytest.raises(CF.AccessError): CF.channel_details(token, channelID)
def test_photo_notlogin(): reset_data() A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning") token = A['token'] auth_logout(token) img_url = "http://ichef.bbci.co.uk/onesport/cps/480/mcs/media/images/57210000/jpg/_57210683_57210682.jpg" x_start = 0 y_start = 0 x_end = 200 y_end = 200 base = 5001 with pytest.raises(UF.AccessError): UF.user_profiles_uploadphoto(token, img_url, x_start, y_start, x_end, y_end, base)
def test_Not_login(): #get token token = A['token'] #logout auth_logout(token) #get channelID channelID = Pub_channel['channel_id'] #start start = '0' with pytest.raises(CF.AccessError): CF.channel_messages(token, channelID, start)
def test_auth_logout(): ''' Test functions for auth_logout ''' data.initialise_all() # Test logging out a rubbish token assert auth.auth_logout("bad") == {"is_success": False} # A user is registered user = auth.auth_register("*****@*****.**", "valid_password", "a", "b") #Confirming user is logged in assert channel.channels_create(user["token"], "testing", False) == { "channel_id": 0 } # User is logged out, creating channel will now raise token error assert auth.auth_logout(user["token"]) == {"is_success": True} with pytest.raises(AccessError, match="token"): channel.channels_create(user["token"], "testing2", True)
def test_auth_logout(): reset_data() A = AF.auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee") AF.auth_logout(A['token'])
def test_ALL_Not_login_NoAd(): token = A['token'] auth_logout(token) with pytest.raises(CF.AccessError): CF.channels_listall(token)
def auth_logout(): """ Given an active token, invalidates the token to log the user out """ token = request.form.get("token") return dumps(auth.auth_logout(token))