diff --git a/examples/data/a_b_c/T1_test.py b/examples/data/a_b_c/T1_test.py index 5adf2afd..c65163c7 100644 --- a/examples/data/a_b_c/T1_test.py +++ b/examples/data/a_b_c/T1_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: a-b.c/1.yml from httprunner import HttpRunner, Config, Step, RunRequest diff --git a/examples/data/a_b_c/T2_3_test.py b/examples/data/a_b_c/T2_3_test.py index 4411bed1..c28c7574 100644 --- a/examples/data/a_b_c/T2_3_test.py +++ b/examples/data/a_b_c/T2_3_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: a-b.c/2 3.yml from httprunner import HttpRunner, Config, Step, RunRequest from httprunner import RunTestCase diff --git a/examples/postman_echo/cookie_manipulation/hardcode_test.py b/examples/postman_echo/cookie_manipulation/hardcode_test.py index d6d08ffc..9abb014e 100644 --- a/examples/postman_echo/cookie_manipulation/hardcode_test.py +++ b/examples/postman_echo/cookie_manipulation/hardcode_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.1.4 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: cookie_manipulation/hardcode.yml from httprunner import HttpRunner, Config, Step, RunRequest diff --git a/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py b/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py index ea9abbc3..fd408d13 100644 --- a/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py +++ b/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.1.4 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: cookie_manipulation/set_delete_cookies.yml from httprunner import HttpRunner, Config, Step, RunRequest diff --git a/examples/postman_echo/request_methods/hardcode_test.py b/examples/postman_echo/request_methods/hardcode_test.py index a74f4aaa..ced3aa60 100644 --- a/examples/postman_echo/request_methods/hardcode_test.py +++ b/examples/postman_echo/request_methods/hardcode_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: request_methods/hardcode.yml from httprunner import HttpRunner, Config, Step, RunRequest diff --git a/examples/postman_echo/request_methods/request_with_functions_test.py b/examples/postman_echo/request_methods/request_with_functions_test.py index cba5888f..24596d75 100644 --- a/examples/postman_echo/request_methods/request_with_functions_test.py +++ b/examples/postman_echo/request_methods/request_with_functions_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: request_methods/request_with_functions.yml from httprunner import HttpRunner, Config, Step, RunRequest diff --git a/examples/postman_echo/request_methods/request_with_parameters_test.py b/examples/postman_echo/request_methods/request_with_parameters_test.py index 0755d95e..1b2d3e02 100644 --- a/examples/postman_echo/request_methods/request_with_parameters_test.py +++ b/examples/postman_echo/request_methods/request_with_parameters_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: request_methods/request_with_parameters.yml import pytest diff --git a/examples/postman_echo/request_methods/request_with_testcase_reference_test.py b/examples/postman_echo/request_methods/request_with_testcase_reference_test.py index 19aebb1d..d8b5a079 100644 --- a/examples/postman_echo/request_methods/request_with_testcase_reference_test.py +++ b/examples/postman_echo/request_methods/request_with_testcase_reference_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: request_methods/request_with_testcase_reference.yml from httprunner import HttpRunner, Config, Step, RunRequest from httprunner import RunTestCase diff --git a/examples/postman_echo/request_methods/request_with_variables_test.py b/examples/postman_echo/request_methods/request_with_variables_test.py index 89aaef48..ae6b9dd3 100644 --- a/examples/postman_echo/request_methods/request_with_variables_test.py +++ b/examples/postman_echo/request_methods/request_with_variables_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: request_methods/request_with_variables.yml from httprunner import HttpRunner, Config, Step, RunRequest diff --git a/examples/postman_echo/request_methods/validate_with_functions_test.py b/examples/postman_echo/request_methods/validate_with_functions_test.py index d75de2fe..1ad20418 100644 --- a/examples/postman_echo/request_methods/validate_with_functions_test.py +++ b/examples/postman_echo/request_methods/validate_with_functions_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: request_methods/validate_with_functions.yml from httprunner import HttpRunner, Config, Step, RunRequest diff --git a/examples/postman_echo/request_methods/validate_with_variables_test.py b/examples/postman_echo/request_methods/validate_with_variables_test.py index aa06a855..1fb72705 100644 --- a/examples/postman_echo/request_methods/validate_with_variables_test.py +++ b/examples/postman_echo/request_methods/validate_with_variables_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.3.0 +# NOTE: Generated By HttpRunner v4.3.5 # FROM: request_methods/validate_with_variables.yml from httprunner import HttpRunner, Config, Step, RunRequest diff --git a/httprunner/client_test.py b/httprunner/client_test.py index 9fd32ca8..467d4246 100644 --- a/httprunner/client_test.py +++ b/httprunner/client_test.py @@ -8,10 +8,10 @@ class TestHttpSession(unittest.TestCase): self.session = HttpSession() def test_request_http(self): - self.session.request("get", "https://httpbin.org/get") + self.session.request("get", "http://httpbin.org/get") address = self.session.data.address self.assertGreater(len(address.server_ip), 0) - self.assertEqual(address.server_port, 443) + self.assertEqual(address.server_port, 80) self.assertGreater(len(address.client_ip), 0) self.assertGreater(address.client_port, 10000) @@ -26,7 +26,7 @@ class TestHttpSession(unittest.TestCase): def test_request_http_allow_redirects(self): self.session.request( "get", - "https://httpbin.org/redirect-to?url=https%3A%2F%2Fgithub.com", + "http://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", - "https://httpbin.org/redirect-to?url=https%3A%2F%2Fgithub.com", + "http://httpbin.org/redirect-to?url=https%3A%2F%2Fgithub.com", allow_redirects=False, ) address = self.session.data.address diff --git a/httprunner/utils.py b/httprunner/utils.py index f8fb845d..6402e909 100644 --- a/httprunner/utils.py +++ b/httprunner/utils.py @@ -77,7 +77,7 @@ class GA4Client(object): } payload = { - "client_id": f"{random.randint(-2147483648, 2147483647)}.{int(time.time())}", + "client_id": f"{int(random.random() * 10**8)}.{int(time.time())}", "user_id": self.user_id, "timestamp_micros": int(time.time() * 10**6), "events": [event],