Commit ed51c636 by liuxiaoxing

asa参数校验

parent 92297674
......@@ -1072,6 +1072,72 @@ def test_iad_error_info4():
# token为空
def test_token1():
data[0]['asa_info']['adservices_info']['token'] = ""
response = send_request()
assert response["status"] == "0"
# token为正常值
def test_token2():
data[0]['asa_info']['adservices_info']['token'] = "k+q1PtvKksjrtMbqONmlPeOztkXqSJ1xqux9EFXvZUAhY5R8szPkUwKOf0nc4d84FvRKY9LZ+3ncRBXuDeFmrtq+WbkEWxgTXwAAAVADAAAA9gAAAIBv7KMoc3AHIi4QyzGWI67z4cAqk9IocPPaAQXHcyM9OVtdMCcg6b0m8EI+27BKknAWOUA9ZoUiQ0vuERiCWWW7tzOZ5pgcnuoYzn18jnlTTTtisEHhw/JLBHg6c8aR/I/mBk11+iMdEAZvQZ68aKwzI3rmmI3Kz/5h9zcZHTphIQAAABV3tAsFnsbMHeC7RT7ymgRtJ+1KiWgAAACfAfzmGF1G6TvapSaorph2MlE1rj/2AAAAhgUFMRHeByS1h0HmhTUPcsgZFWKLpvkZJBORRTKgdLTblWSAdj9yeJ0J/vgK15qBW4eOJELfVGrSBCclb5aqqCNUlhf9a35XXX21822C+FznX7zSfbcB/eOfeyAykz61bLPLjbsw0ZADMUgh+HvAOB6BTypPqinj8+kEYGQsu3tnqC4ZmIudAAAAAAAAAAAAAAABBEUNAAA="
response = send_request()
assert response["status"] == "0"
# adservices_retry_times为空
def test_adservices_retry_times1():
data[0]['asa_info']['adservices_info']['adservices_retry_times'] = ""
response = send_request()
assert response["status"] == "0"
# adservices_retry_times为正number类型
def test_adservices_retry_times2():
data[0]['asa_info']['adservices_info']['adservices_retry_times'] = 2
response = send_request()
assert response["status"] == "0"
# adservices_retry_times为string类型
def test_adservices_retry_times3():
data[0]['asa_info']['adservices_info']['adservices_retry_times'] = "3"
response = send_request()
assert response["status"] == "0"
# adservices_retry_times为3个字符
def test_adservices_retry_times4():
data[0]['asa_info']['adservices_info']['adservices_retry_times'] = code_nums2(3)
response = send_request()
assert response["status"] == "215"
# adservices_retry_times为中文和字符
def test_adservices_retry_times5():
data[0]['asa_info']['adservices_info']['adservices_retry_times'] = '测#'
response = send_request()
assert response["status"] == "0"
# adservices_error_info为空
def test_adservices_error_info1():
data[0]['asa_info']['adservices_info']['adservices_error_info'] = ''
response = send_request()
assert response["status"] == "0"
# adservices_error_info为1000字符
def test_adservices_error_info2():
data[0]['asa_info']['adservices_info']['adservices_error_info'] = code_nums1(1000)
response = send_request()
assert response["status"] == "0"
if __name__ == '__main__':
pytest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment