示例#1
0
def test_sethandle05():
    new_user = create_user()
    sethandle(new_user['token'],"a" * 20)
    new_user_dictionary = {
        "user": {
            "u_id" : new_user["u_id"],
            "email" : "*****@*****.**",
            "name_first" : "John",
            "name_last" : "Smith",
            "handle_str": "a" * 20
        }
    }
    assert new_user_dictionary == profile(new_user['token'],new_user['u_id'])
示例#2
0
def test_sethandle07():
    with pytest.raises(AccessError):
        sethandle('NOT_VALID_TOKEN','randomhandle')
示例#3
0
def test_sethandle06():
    new_user = create_user()
    test_user = auth.register('*****@*****.**','Test', 'John', 'Smith')
    with pytest.raises(InputError):
        sethandle(new_user['token'],test_user['handle_str'])
示例#4
0
def test_sethandle03():
    new_user = create_user()
    with pytest.raises(InputError):
        sethandle(new_user['token'],'a' * 20)
示例#5
0
def user_sethandle():
    data = request.get_json()
    return dumps(user.sethandle(data["token"], data["handle_str"]))