예제 #1
0
def test_user_handle_success():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    token = A['token']
    handle = 'goodmorning1'
    
    UF.user_profile_sethandle(token, handle)
def test_user_success():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    token = A['token']
    u_id = A['u_id']

    UF.user_profile(token, u_id)
def test_user_profile_success():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    token = A['token']
    name_first = 'Hello'
    name_last = 'World'

    UF.user_setname(token, name_first, name_last)
def test_details_highPermission_succ():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    Pub_channel = CF.channels_create(A['token'], 'NextChannel', 'True')
    token = A['token']
    channelID = Pub_channel['channel_id']

    CF.channel_details(token, channelID)
예제 #5
0
def test_change_success():
    reset_data()
    O = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    token = O['token']
    Pub_channel = CF.channels_create(O['token'], 'NameChanging', 'True')
    channelID = Pub_channel['channel_id']

    CF.channel_name_change(token, channelID, 'Name1')
예제 #6
0
def test_succ_left():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    Pub_channel = CF.channels_create(A['token'], 'Num4', 'True')
    token = A['token']
    channelID = Pub_channel['channel_id']

    CF.channel_leave(token, channelID)
예제 #7
0
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_Invalid():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    token = A['token']
    u_id = A['u_id'] + 10010

    with pytest.raises(UF.AccessError):
        UF.user_profile(token, u_id)
def test_set_channel_success():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    Pub_channel = channels_create(A['token'], 'STDChannel', 'True')

    token = A['token']
    channel_id = Pub_channel['channel_id']
    OF.standup_active(token, channel_id)
def test_user_invalidID():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    u_id = None
    token = A['token']

    with pytest.raises(TypeError):
        UF.user_profile(token, u_id)
예제 #11
0
def test_channel_Succjoined():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    Pub_channel = CF.channels_create(A['token'], 'Num3', 'True')
    token = A['token']
    channelID = Pub_channel['channel_id']

    CF.channel_join(token, channelID)
예제 #12
0
def test_user_setHand_handle():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    token = A['token']
    handle = None
    
    with pytest.raises(TypeError):
        UF.user_profile_sethandle(token, handle)
def test_delete_success():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    Pub_channel = CF.channels_create(A['token'], 'DeleteChannel', 'True')
    token = A['token']
    channelID = Pub_channel['channel_id']
    
    CF.channel_delete(token, channelID)
예제 #14
0
def test_user_handle_Existed():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    token = A['token']
    handle = 'goodmorning'
    
    with pytest.raises(UF.ValueError):
        UF.user_profile_sethandle(token, handle)
def test_cant_promote():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    Pub_channel = CF.channels_create(A['token'], 'Test1', 'True')
    token = A['token']
    u_id = 1234567
    channelID = Pub_channel['channel_id'] 
    
    CF.channel_addowner(token, channelID, u_id)
def test_validationOFtoken():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    Pub_channel = CF.channels_create(A['token'], 'NextChannel', 'True')
    token = A['token'] + '45645'
    channelID = Pub_channel['channel_id']

    with pytest.raises(TF.AccessError):
        CF.channel_details(token, channelID)
def test_invalid_channelID():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    Pub_channel = CF.channels_create(A['token'], 'NextChannel', 'True')
    token = A['token']
    channelID = Pub_channel['channel_id'] + 45645

    with pytest.raises(CHF.ValueError):
        CF.channel_details(token, channelID)
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_invlaid_channelID_ADOWNER():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    token = A['token']
    channelID = None
    u_id = B['u_id']
    
    with pytest.raises(TypeError):
        CF.channel_addowner(token, channelID, u_id)
예제 #20
0
def test_set_success():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    Pub_channel = channels_create(A['token'], 'StdChannel', 'True')
    token = A['token']
    channelID = Pub_channel['channel_id']
    length = '15'

    OF.standup_start(token, channelID, length)
def test_user_lName():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    token = A['token']
    name_first = 'Hello'
    name_last = 123445

    with pytest.raises(HF.TypeError):
        UF.user_setname(token, name_first, name_last)
예제 #22
0
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_lastname_tooLong():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    token = A['token']
    name_first = 'Hellows'
    name_last = 'W' * 51

    with pytest.raises(HF.ValueError):
        UF.user_setname(token, name_first, name_last)
예제 #24
0
def test_password_not_inDB():
    reset_data()
    A = AF.auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    AF.auth_passwordreset_request("*****@*****.**")
    
    code = AHF.generate_reset_code()
    password = '******'
     
    with pytest.raises(AF.ValueError):
        AF.auth_passwordreset_reset(code, password)
예제 #25
0
def test_Invalid_public_channelID():    
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    B = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    token = A['token']
    u_id = B['u_id']
    channelID = Pub_channel['channel_id'] + 10086
    
    with pytest.raises(CHF.AccessError):
        CF.channel_invite(token, channelID, u_id)
def test_set_successful():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    B = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    Pub_channel = channels_create(A['token'], 'STDChannel', 'True')
    token = A['token']
    channelID = Pub_channel['channel_id']
    length = '15'
    
    OF.standup_start(token, channelID, length)
def test_channel_Invalid():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    Pub_channel = channels_create(A['token'], 'STDChannel', 'True')
    token = A['token']
    channelID = Pub_channel['channel_id'] + 10086
    length = '15'
    
    with pytest.raises(CHF.ValueError):
        OF.standup_start(token, channelID, length)
예제 #28
0
def test_channel_invite_success():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    B = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    Pub_channel = CF.channels_create(A['token'], 'Num2', 'True')
    channelID = Pub_channel['channel_id']
    token = A['token']
    u_id = B['u_id']
    
    CF.channel_invite(token, channelID, u_id)
def test_delete_NotOwner():
    reset_data()
    A = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    B = auth_register("*****@*****.**", "wsad1990", "Bad", "Night")
    Pub_channel = CF.channels_create(A['token'], 'DeleteChannel', 'True')
    token = B['token']
    channelID = Pub_channel['channel_id']
    CF.channel_join(token, channelID)
    with pytest.raises(CF.ValueError):
        CF.channel_delete(token, channelID)
def test_noAdmain_join_list():
    reset_data()
    A = auth_register("*****@*****.**", 'HoyaLee2019', "Hoya", "Lee")
    B = auth_register("*****@*****.**", "wsad1990", "Good", "Morning")
    Pub_channel = CF.channels_create(A['token'], 'Num2', 'True')
    channelID = Pub_channel['channel_id']
    token1 = B['token']
    CF.channel_join(token1, channelID)

    CF.channels_list(token1)