Ejemplo n.º 1
0
def test_login(login_data1, url, baserequests,register):
    print(f"测试数据为:{login_data1['casedata']}")
    print(f"预期结果为:{login_data1['expect']}")
    r = Member.login(url, baserequests, login_data1['casedata'])
    assert str(r.json()['msg']) == str(login_data1['expect']['msg'])
    assert str(r.json()['status']) == str(login_data1['expect']['status'])
    assert str(r.json()['code']) == str(login_data1['expect']['code'])
Ejemplo n.º 2
0
def test_login(register, login_data, url, baserequests):
    # 登录
    r = Member.login(url, baserequests, login_data['casedata'])
    # 检查登录的结果
    assert r.json()['msg'] == login_data['expect']['msg']
    assert r.json()['status'] == login_data['expect']['status']
    assert r.json()['code'] == login_data['expect']['code']
Ejemplo n.º 3
0
def test_login_fail(fail_data, url, baserequests):
    # 发送请求
    r = Member.login(url, baserequests, fail_data['casedata'])
    # 检查结果
    assert str(r.json()['msg']) == str(fail_data['expect']['msg'])
    assert str(r.json()['status']) == str(fail_data['expect']['status'])
    assert str(r.json()['code']) == str(fail_data['expect']['code'])
Ejemplo n.º 4
0
def test_login(register, login_data, url, baserequestes):
    # 登录
    # 检查登录结果
    # 发送请求
    r = Member.login(url, baserequestes, login_data['casedata'])
    print(r.text)
    assert str(r.json()['msg']) == str(login_data['expect']['msg'])
Ejemplo n.º 5
0
def test_login(register, login_data, url, baserequests):
    # 登录
    # 检查登录的结果
    r = Member.login(url, baserequests, login_data['casedata'])
    assert str(r.json()['msg']) == str(login_data['expect']['msg'])
    assert str(r.json()['status']) == str(login_data['expect']['status'])
    assert str(r.json()['code']) == str(login_data['expect']['code'])
Ejemplo n.º 6
0
def test_login_fail(path_data2, db, url, baserequests):
    print(f"测试数据为:{path_data2['casedata']}")
    print(f"预期结果为:{path_data2['except']}")
    r = Member.login(url, baserequests, path_data2['casedata'])
    #  1.检查响应结果
    assert r.json()['msg'] == path_data2['except']['msg']
    assert r.json()['status'] == path_data2['except']['status']
    assert r.json()['code'] == path_data2['except']['code']
Ejemplo n.º 7
0
def test_login_pass(pass_data, url, baserequestes):
    print(f"测试数据:{pass_data['casedata']}")
    print(f"预期结果:{pass_data['expect']}")
    # 发送请求
    r = Member.login(url, baserequestes, pass_data['casedata'])
    # 检查响应结果
    assert str(r.json()['msg']) == str(pass_data['expect']['msg'])
    assert str(r.json()['code']) == str(pass_data['expect']['code'])
    assert str(r.json()['status']) == str(pass_data['expect']['status'])
Ejemplo n.º 8
0
def test_login(register, login_data, url, baserequests):
    # 登录
    print(f"测试数据为:{login_data['casedata']}")
    print(f"预测结果为:{login_data['expect']}")
    # 检查登录结果
    r = Member.login(url, baserequests, login_data['casedata'])
    assert str(r.json()['msg']) == str(login_data['expect']['msg'])
    assert str(r.json()['status']) == str(login_data['expect']['status'])
    assert str(r.json()['code']) == str(login_data['expect']['code'])
Ejemplo n.º 9
0
def test_login_fail(file_data, url, baserequestes):
    print(f"测试数据:{file_data['casedata']}")
    print(f"预期结果:{file_data['expect']}")
    # 发送请求
    r = Member.login(url, baserequestes, file_data['casedata'])
    print(r.text)
    # 检查结果
    assert str(r.json()['msg']) == str(file_data['expect']['msg'])
    assert str(r.json()['code']) == str(file_data['expect']['code'])
    assert str(r.json()['status']) == str(file_data['expect']['status'])
Ejemplo n.º 10
0
def test_login_fial(fail_data, url, baserequests):
    print(f"测试数据为:{fail_data['casedata']}")
    print(f"预期结果为:{fail_data['expect']}")

    # 发送请求
    r = Member.login(url, baserequests, fail_data["casedata"])
    print(r)
    # 检查结果
    assert r.json()["status"] == fail_data["expect"]["status"]
    assert r.json()["code"] == fail_data["expect"]['code']
Ejemplo n.º 11
0
def test_login_fail(fail_data, url, baserequests):
    print(f"测试数据为: {fail_data['casedata']}")
    print(f"预期结果为: {fail_data['expect']}")

    r = Member.login(url, baserequests, fail_data['casedata'])
    # print(r)
    # 检查结果
    assert str(r.json()['msg']) == str(fail_data['expect']['msg'])
    assert str(r.json()['status']) == str(fail_data['expect']['status'])
    assert str(r.json()['code']) == str(fail_data['expect']['code'])
Ejemplo n.º 12
0
def test_login_pass(test_register_forloginpass, login_success_data, url,
                    baserequests):
    print(f"测试数据为:{login_success_data['casedata']}")
    print(f"预期结果为为:{login_success_data['expect']}")
    # 发送请求
    r = Member.login(url, baserequests, data=login_success_data['casedata'])
    # 检查结果
    # assert r.json()['msg'] == success_data['expect']['msg']
    assert r.json()['status'] == login_success_data['expect']['status']
    assert r.json()['code'] == login_success_data['expect']['code']
Ejemplo n.º 13
0
def test_login(pass_data, url, baserequests):
    print(f"测试数据为:{pass_data['casedata']}")
    print(f"预期结果为:{pass_data['expect']}")
    phone = pass_data['casedata']['mobilephone']

    # 发送请求
    r = Member.login(url, baserequests, pass_data["casedata"])
    print(r)
    # 检查结果
    assert r.json()["status"] == pass_data["expect"]["status"]
    assert r.json()["code"] == pass_data["expect"]['code']
Ejemplo n.º 14
0
def test_login_pass(pass_data, url, db, baserequests):
    print(f"测试数据为:{pass_data['casedata']}")
    print(f"预测结果为:{pass_data['expect']}")
    phone = pass_data['casedata']['mobilephone']

    r = Member.login(url, baserequests, pass_data['casedata'])

    assert str(r.json()['msg']) == str(pass_data['expect']['msg'])
    assert str(r.json()['status']) == str(pass_data['expect']['status'])
    assert str(r.json()['code']) == str(pass_data['expect']['code'])

    r = Member.getList(url, baserequests)
    assert str(phone) in r.text
Ejemplo n.º 15
0
def test_login(register, login_data, url, baserequests):
    # 下发登录的请求
    r = Member.login(url, baserequests, login_data['casedata'])
    # 检查结果
    assert r.json()['msg'] == login_data['expect']['msg']
    assert str(r.json()['code']) == str(login_data['expect']['code'])
Ejemplo n.º 16
0
def test_login(register, fail_data, ur1, baserequests):
    # 登录
    # 检查登录的结果
    r = Member.login(ur1, baserequests, fail_data['casedata'])
    assert r.json()['msg'] == fail_data['expect']['msg']
Ejemplo n.º 17
0
def test_login_pass(pass_data, baserequests, url, a):
    # 发送登录请求
    r = Member.login(url, baserequests, pass_data['casedata'])
    assert r.json()['msg'] == pass_data['expect']['msg']
    assert r.json()['status'] == pass_data['expect']['status']
    assert str(r.json()['code']) == pass_data['expect']['code']
Ejemplo n.º 18
0
def test_login(register, login_data,url, baserequests):
    # 登录
    # 检查登录结果
    r = Member.login(url, baserequests, login_data['casedata'])
    assert r.json()['msg'] == login_data['expect']['msg']