def setHandle(): data = getData() handle_str, token = (request.form[x] for x in ('handle_str', 'token')) checkTokenValidity(token, data) user_profile_sethandle(data, token, handle_str) return sendSuccess({})
def test_user_profile_sethandle_invaild_token(): with pytest.raises(errors.ValueError): user_profile_sethandle(data, 'invaildToken', "Sherry")
def test_user_profile_sethandle_used(): with pytest.raises(errors.ValueError): user_profile_sethandle(data, token, "chrisbirkin")
def test_user_profile_sethandle_invalid_10(): with pytest.raises(errors.ValueError): user_profile_sethandle(data, token, "")
def test_user_profile_sethandle_correct(): user_profile_sethandle(data, token, "Sherry") user_profile_sethandle(data, token, "SherryBirkin") user_profile_sethandle(data, token, "sherry1234") user_profile_sethandle(data, token, "MissSherry") user_profile_sethandle(data, token, "1234") user_profile_sethandle(data, token, "Sherry12345678912345")
def test_user_profile_sethandle_invalid_06(): with pytest.raises(errors.ValueError): user_profile_sethandle(data, token, "Sherry.Birkin")
def test_user_profile_sethandle_long_02(): with pytest.raises(errors.ValueError): user_profile_sethandle(data, token, "Sherry123456789123456789sdfsgsgfgdsds")