示例#1
0
def test_auth_login_both_valid01():
    BF.data['user_info'] = []
    authRegisterDic = BF.user_register('*****@*****.**', '1234567', 'Andy',
                                       'Wei')
    result = BF.user_login('*****@*****.**', '1234567')
    assert result['token'] == authRegisterDic['token']
    assert result['u_id'] == authRegisterDic['u_id']
示例#2
0
def test_user_profile_setemail_1():
    BF.data['user_info'] = []
    authRegisterDic = BF.user_register('*****@*****.**', '12345678', 'smit',
                                       'dob')
    result = BF.user_login('*****@*****.**', '12345678')
    assert result['token'] == authRegisterDic['token']
    assert result['u_id'] == authRegisterDic['u_id']
    BF.user_profile_setemail(result['token'], '*****@*****.**')
示例#3
0
def test_user_profile_setname_4():
    BF.data['user_info'] = []
    authRegisterDic = BF.user_register('*****@*****.**', '1234567', 'Andy', 'Wei')
    result = BF.user_login('*****@*****.**', '1234567')
    assert result['token'] == authRegisterDic['token']
    assert result['u_id'] == authRegisterDic['u_id']
    with pytest.raises(BF.ValueError):
        BF.user_profile_setname('1234567', 'a' * 1000, "andy")
示例#4
0
def test_user_profile_setname_2():
    BF.data['user_info'] = []
    authRegisterDic = BF.user_register('*****@*****.**', '1234567', 'Andy', 'Wei')
    result = BF.user_login('*****@*****.**', '1234567')
    assert result['token'] == authRegisterDic['token']
    assert result['u_id'] == authRegisterDic['u_id']
    with pytest.raises(BF.ValueError):
        BF.user_profile_setname(
            '1234567',
            'abcdefghijklmnopqrstuvwxyz123456789012345678901234567890', 'wei')
示例#5
0
def test_auth_login_email_is_not_user_invalid():
    BF.data['user_info'] = []
    authRegisterDic = BF.user_register('*****@*****.**', '1234567', 'Andy',
                                       'Wei')
    with pytest.raises(BF.ValueError):
        BF.user_login('*****@*****.**', '123456')
示例#6
0
def test_auth_login_email_invalid():
    BF.data['user_info'] = []
    authRegisterDic = BF.user_register('*****@*****.**', '1234567', 'Andy',
                                       'Wei')
    with pytest.raises(BF.ValueError):
        BF.user_login('1337memesgmail.com', '1234567')
示例#7
0
def test_auth_login_password_invalid():
    BF.data['user_info'] = []
    authRegisterDic = BF.user_register('*****@*****.**', '1234567', 'Andy',
                                       'Wei')
    with pytest.raises(BF.ValueError):
        BF.user_login('*****@*****.**', '2242')