Exemplo n.º 1
0
def replace_data(s):
    value = ""
    s_l = s.split(" ")
    if (s_l[1].find('字符') != -1 or s_l[1].find('string') != -1):
        s_l[2] = s_l[2].replace(',', ',')
        length = get_length(s_l[2])
        value = get_str(length, s_l[3:])
    elif (s_l[1].find("地址") != -1):
        value = random_tool.random_addr()
    elif (s_l[1].find("手机") != -1):
        value = random_tool.random_tell()
    elif (s_l[1].find("邮箱") != -1):
        value = random_tool.random_email()
    elif (s_l[1].find("姓名") != -1):
        value = random_tool.random_name()
    elif (s_l[1].find("数字") != -1):
        s_l[2] = s_l[2].replace(',', ',')
        value = get_length(s_l[2])
    elif (s_l[1].find("身份证") != -1):
        value = make_info()["身份证号"]
    elif (s_l[1].find("银行卡号") != -1):
        value = random_card()
    elif (s_l[1].find("颜色") != -1):
        value = colors()
    elif (s_l[1].find("尺寸") != -1):
        value = sizes()
    else:
        value = None
    return value
Exemplo n.º 2
0
def test_sign():
    url = 'http://qa.yansl.com:8084/signup'
    phone = random_tool.random_tell()
    pwd = random_tool.random_pwd()
    re_pwd = pwd
    user_name = random_tool.random_name_pinyin()
    num = random_tool.random_number(10, 99)
    req = {
        "phone": phone,
        "pwd": pwd,
        "rePwd": re_pwd,
        "userName": user_name + str(num)
    }
    resp = request_tool.post_json(url, json=req)
    resp_json = resp.json()
    code = resp_json['code']
    assert code == 2000
Exemplo n.º 3
0
def test_sign():
    url = 'qa.yansl.com:8084/signup'
    phone = random_tool.random_tell()
    pwd = random_tool.random_pwd()
    re_pwd = pwd
    user_name = random_tool.random_name_pinyin()
    num = random_tool.random_number(10, 99)
    req = {
        "phone": phone,
        "pwd": pwd,
        "rePwd": re_pwd,
        "userName": user_name + str(num)
    }

    resp = request_tool.post_json(url, json=req)
    resp_json = resp.json()
    code = resp_json['code']
    assert code == 2000
    #  logger('注册shibai').error('自知则知之')
    logger("注册").info("账号或者密码错误")