From b505e2a7bd5c4cf8f5ec9d4b71b9272c384fdc5d Mon Sep 17 00:00:00 2001 From: IML Date: Sun, 6 Jun 2021 01:29:02 +0900 Subject: [PATCH] add test case - add test case - update CHANGES.rst --- CHANGES.rst | 9 +++++++++ tests/test_basic.py | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index f4e0b5d0..03374344 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,5 +1,14 @@ .. currentmodule:: flask + +Version 2.1.1 +------------- + +Unreleased + +- Add specified HTTP method validation. + + Version 2.1.0 ------------- diff --git a/tests/test_basic.py b/tests/test_basic.py index 2cb96794..eb62a491 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -2026,3 +2026,11 @@ def test_app_freed_on_zero_refcount(): assert weak() is None finally: gc.enable() + + +def test_validate_http_method_route(app, client): + + with pytest.raises(TypeError): + @app.route("/", methods=["BAD_METHOD"]) + def bad_method_func(): + return "Hello World" \ No newline at end of file