From 0137294a2c7cc10465935e39d5232119d47f6c77 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 6 Jan 2020 14:27:03 +0800 Subject: [PATCH 1/2] fix: HTTP method missed "CONNECT", "TRACE" --- docs/CHANGELOG.md | 6 ++++++ httprunner/__init__.py | 2 +- httprunner/loader/schemas/common.schema.json | 4 +++- pyproject.toml | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 995fc35a..7c3cfe82 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 2.5.5 (2020-01-06) + +**Fixed** + +- fix: HTTP method missed "CONNECT", "TRACE" + ## 2.5.4 (2020-01-03) **Added** diff --git a/httprunner/__init__.py b/httprunner/__init__.py index 748f3812..97bfb536 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.5.4" +__version__ = "2.5.5" __description__ = "One-stop solution for HTTP(S) testing." __all__ = ["__version__", "__description__"] diff --git a/httprunner/loader/schemas/common.schema.json b/httprunner/loader/schemas/common.schema.json index 67a33961..8986240c 100644 --- a/httprunner/loader/schemas/common.schema.json +++ b/httprunner/loader/schemas/common.schema.json @@ -136,7 +136,9 @@ "HEAD", "PUT", "PATCH", - "DELETE" + "DELETE", + "CONNECT", + "TRACE" ] }, "url": { diff --git a/pyproject.toml b/pyproject.toml index 2b8d9212..bdcec61b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "httprunner" -version = "2.5.4" +version = "2.5.5" description = "One-stop solution for HTTP(S) testing." license = "Apache-2.0" readme = "README.md" From 030010fcb39fa1acb2baa22639cf2b1f06586d65 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 6 Jan 2020 14:37:49 +0800 Subject: [PATCH 2/2] change: remove method validation from runner.Runner --- docs/CHANGELOG.md | 4 ++++ httprunner/runner.py | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7c3cfe82..b91541fb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,6 +6,10 @@ - fix: HTTP method missed "CONNECT", "TRACE" +**Changed** + +- change: remove method validation from runner.Runner + ## 2.5.4 (2020-01-03) **Added** diff --git a/httprunner/runner.py b/httprunner/runner.py index 7f24f1b5..aa163f52 100644 --- a/httprunner/runner.py +++ b/httprunner/runner.py @@ -230,14 +230,6 @@ class Runner(object): except KeyError: raise exceptions.ParamsError("URL or METHOD missed!") - # TODO: move method validation to json schema - valid_methods = ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"] - if method.upper() not in valid_methods: - err_msg = u"Invalid HTTP method! => {}\n".format(method) - err_msg += "Available HTTP methods: {}".format("/".join(valid_methods)) - logger.log_error(err_msg) - raise exceptions.ParamsError(err_msg) - logger.log_info("{method} {url}".format(method=method, url=parsed_url)) logger.log_debug( "request kwargs(raw): {kwargs}".format(kwargs=parsed_test_request))