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'])
def test_sethandle07(): with pytest.raises(AccessError): sethandle('NOT_VALID_TOKEN','randomhandle')
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'])
def test_sethandle03(): new_user = create_user() with pytest.raises(InputError): sethandle(new_user['token'],'a' * 20)
def user_sethandle(): data = request.get_json() return dumps(user.sethandle(data["token"], data["handle_str"]))