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']
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'], '*****@*****.**')
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")
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')
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')
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')
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')