Ejemplo n.º 1
0
def test_user_profile_3():
    reset_users()
    user_dict1 = auth_register('*****@*****.**', 'hello123', 'Steven', 'Lay')
    user1 = user_dict1['token']
    user1_id = user_dict1['u_id']
    invalid_id = user1_id + 1
    with pytest.raises(ValueError):
        profile_dict3 = user_profile(user1, invalid_id)
Ejemplo n.º 2
0
def test_user_profile_1():
    reset_users()
    user_dict1 = auth_register('*****@*****.**', 'hello123', 'Steven', 'Lay')
    user1 = user_dict1['token']
    user1_id = user_dict1['u_id']
    profile_dict1 = user_profile(user1, user1_id)
    assert (profile_dict1 == {
        'email': '*****@*****.**',
        'name_first': 'Steven',
        'name_last': 'Lay',
        'handle_str': 'StevenLay'
    })
Ejemplo n.º 3
0
def test_user_profile_sethandle_6():
    reset_users()
    user_dict1 = auth_register("*****@*****.**", "password", "firstname",
                               "lastname")
    u_token = user_dict1['token']
    u_id = user_dict1['u_id']
    user_profile_sethandle(u_token, '!@#$%^&*()+_-=|/\{}?')
    assert (user_profile(u_token, u_id) == {
        'email': '*****@*****.**',
        'name_first': 'firstname',
        'name_last': 'lastname',
        'handle_str': '!@#$%^&*()+_-=|/\{}?'
    })
Ejemplo n.º 4
0
def test_user_profile_setemail_4():
    reset_users()
    user_dict1 = auth_register("*****@*****.**", "password", "firstname",
                               "lastname")
    u_token = user_dict1['token']
    u_id = user_dict1['u_id']
    user_profile_setemail(u_token, '*****@*****.**')
    assert (user_profile(u_token, u_id) == {
        'email': '*****@*****.**',
        'name_first': 'firstname',
        'name_last': 'lastname',
        'handle_str': 'firstnamelastname'
    })
Ejemplo n.º 5
0
def test_user_profile_setname_5():
    reset_users()
    user_dict1 = auth_register("*****@*****.**", "password", "firstname",
                               "lastname")
    u_token = user_dict1['token']
    u_id = user_dict1['u_id']
    user_profile_setname(u_token, 49 * 'A', 'Smith')
    assert (user_profile(u_token, u_id) == {
        'email': '*****@*****.**',
        'name_first': 49 * 'A',
        'name_last': 'Smith',
        'handle_str': 'firstnamelastname'
    })
Ejemplo n.º 6
0
def test_user_profile_2():
    reset_users()
    user_dict2 = auth_register('*****@*****.**', 'hello123', 'Steven2',
                               'Lay')
    user2 = user_dict2['token']
    user2_id = user_dict2['u_id']
    user_profile_sethandle(user2, 'l33thack3r')
    profile_dict2 = user_profile(user2, user2_id)
    assert (profile_dict2 == {
        'email': '*****@*****.**',
        'name_first': 'Steven2',
        'name_last': 'Lay',
        'handle_str': 'l33thack3r'
    })