mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 01:09:44 +08:00
fix: change httpbin.org from http to https
This commit is contained in:
@@ -8,7 +8,7 @@ class TestHttpSession(unittest.TestCase):
|
||||
self.session = HttpSession()
|
||||
|
||||
def test_request_http(self):
|
||||
self.session.request("get", "http://httpbin.org/get")
|
||||
self.session.request("get", "https://httpbin.org/get")
|
||||
address = self.session.data.address
|
||||
self.assertGreater(len(address.server_ip), 0)
|
||||
self.assertEqual(address.server_port, 80)
|
||||
@@ -26,7 +26,7 @@ class TestHttpSession(unittest.TestCase):
|
||||
def test_request_http_allow_redirects(self):
|
||||
self.session.request(
|
||||
"get",
|
||||
"http://httpbin.org/redirect-to?url=https%3A%2F%2Fgithub.com",
|
||||
"https://httpbin.org/redirect-to?url=https%3A%2F%2Fgithub.com",
|
||||
allow_redirects=True,
|
||||
)
|
||||
address = self.session.data.address
|
||||
@@ -50,7 +50,7 @@ class TestHttpSession(unittest.TestCase):
|
||||
def test_request_http_not_allow_redirects(self):
|
||||
self.session.request(
|
||||
"get",
|
||||
"http://httpbin.org/redirect-to?url=https%3A%2F%2Fgithub.com",
|
||||
"https://httpbin.org/redirect-to?url=https%3A%2F%2Fgithub.com",
|
||||
allow_redirects=False,
|
||||
)
|
||||
address = self.session.data.address
|
||||
|
||||
@@ -10,7 +10,7 @@ Then you can write upload test script as below:
|
||||
- test:
|
||||
name: upload file
|
||||
request:
|
||||
url: http://httpbin.org/upload
|
||||
url: https://httpbin.org/upload
|
||||
method: POST
|
||||
headers:
|
||||
Cookie: session=AAA-BBB-CCC
|
||||
@@ -31,7 +31,7 @@ For compatibility, you can also write upload test script in old way:
|
||||
field2: "value2"
|
||||
m_encoder: ${multipart_encoder(file=$file, field1=$field1, field2=$field2)}
|
||||
request:
|
||||
url: http://httpbin.org/upload
|
||||
url: https://httpbin.org/upload
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: ${multipart_content_type($m_encoder)}
|
||||
@@ -75,7 +75,9 @@ def ensure_upload_ready():
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def prepare_upload_step(step: TStep, step_variables: VariablesMapping, functions: FunctionsMapping):
|
||||
def prepare_upload_step(
|
||||
step: TStep, step_variables: VariablesMapping, functions: FunctionsMapping
|
||||
):
|
||||
"""preprocess for upload test
|
||||
replace `upload` info with MultipartEncoder
|
||||
|
||||
@@ -84,7 +86,7 @@ def prepare_upload_step(step: TStep, step_variables: VariablesMapping, functions
|
||||
{
|
||||
"variables": {},
|
||||
"request": {
|
||||
"url": "http://httpbin.org/upload",
|
||||
"url": "https://httpbin.org/upload",
|
||||
"method": "POST",
|
||||
"headers": {
|
||||
"Cookie": "session=AAA-BBB-CCC"
|
||||
|
||||
Reference in New Issue
Block a user