示例#1
0
def cropPhoto():
    data = getData()
    token = request.form.get('token')
    img_url = request.form.get('url')
    x_start = request.form.get('xstart')
    y_start = request.form.get('ystart')
    x_end = request.form.get('xend')
    y_end = request.form.get('yend')

    user_profile_uploadphoto(data, token, img_url, x_start, y_start, x_end,
                             y_end)
    return sendSuccess({})
示例#2
0
def test_user_profile_setemail_invaild_token():
    with pytest.raises(errors.ValueError):
        user_profile_uploadphoto(data, 'invaildToken', img_url, 600, 900, 100,
                                 400)
示例#3
0
def test_user_profile_uploadphoto_end_larger_02():
    with pytest.raises(errors.ValueError):
        user_profile_uploadphoto(data, token, img_url, 600, 100, 900, 50)
示例#4
0
def test_user_profile_uploadphoto_dimension_06():
    with pytest.raises(errors.ValueError):
        user_profile_uploadphoto(data, token, img_url, 600, 100, 900, 40000)
示例#5
0
def test_user_profile_uploadphoto_jpg():
    with pytest.raises(errors.ValueError):
        user_profile_uploadphoto(data, token, img_url_not_jpg, 10, 10, 200,
                                 200)
示例#6
0
def test_user_profile_uploadphoto_http():
    with pytest.raises(errors.ValueError):
        user_profile_uploadphoto(data, token, img_url_not_200, 600, 100, 900,
                                 400)
示例#7
0
def test_user_profile_uploadphoto_correct():
    user_profile_uploadphoto(data, token, img_url, 600, 100, 900, 400)