本文整理汇总了Python中TestEnv.TestEnv.curl_post_data方法的典型用法代码示例。如果您正苦于以下问题:Python TestEnv.curl_post_data方法的具体用法?Python TestEnv.curl_post_data怎么用?Python TestEnv.curl_post_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestEnv.TestEnv
的用法示例。
在下文中一共展示了TestEnv.curl_post_data方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_200_03
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import curl_post_data [as 别名]
def test_200_03(self):
url = TestEnv.mkurl("https", "cgi", "/hecho.py")
for hex in [ "10", "7f" ]:
r = TestEnv.curl_post_data(url, "name=x%%%s&value=yz" % hex)
assert 0 != r["rv"]
r = TestEnv.curl_post_data(url, "name=x&value=y%%%sz" % hex)
assert 0 != r["rv"]
示例2: test_200_02
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import curl_post_data [as 别名]
def test_200_02(self):
url = TestEnv.mkurl("https", "cgi", "/hecho.py")
for x in range(1, 32):
if 9 != x:
r = TestEnv.curl_post_data(url, "name=x&value=y%%%02x" % x)
if x in [ 10, 13 ]:
assert 0 == r["rv"], "unexpected exit code for char 0x%02x" % x
assert 200 == r["response"]["status"], "unexpected status for char 0x%02x" % x
else:
assert 0 != r["rv"], "unexpected exit code for char 0x%02x" % x
示例3: test_300_02
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import curl_post_data [as 别名]
def test_300_02(self):
url = TestEnv.mkurl("https", "cgi", "/echo.py")
r = TestEnv.curl_post_data(url, 'XYZ', options=[ "-H", "expect: 100-continue" ])
assert 200 == r["response"]["status"]
assert "previous" in r["response"]
assert 100 == r["response"]["previous"]["status"]
示例4: test_300_03
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import curl_post_data [as 别名]
def test_300_03(self):
url = TestEnv.mkurl("https", "cgi", "/echo.py")
r = TestEnv.curl_post_data(url, 'XYZ', options=[ "-H", "expect: the-unexpected" ])
assert 417 == r["response"]["status"]
assert not "previous" in r["response"]
示例5: test_300_01
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import curl_post_data [as 别名]
def test_300_01(self):
url = TestEnv.mkurl("https", "test1", "/index.html")
r = TestEnv.curl_post_data(url, 'XYZ')
assert 200 == r["response"]["status"]
assert not "previous" in r["response"]