From 7513c47ca0021bcef6d2dec038e80175341587c1 Mon Sep 17 00:00:00 2001 From: Gary Gale Date: Fri, 17 Jan 2025 16:23:06 +0000 Subject: [PATCH] test #459: fix failing non HTTP GET tests which called unimplemented example code endpoints --- tests/test_decorator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_decorator.py b/tests/test_decorator.py index 27f72c9..8ee0630 100644 --- a/tests/test_decorator.py +++ b/tests/test_decorator.py @@ -1,3 +1,4 @@ +from http import HTTPStatus import time from typing import Any, Generator @@ -102,11 +103,13 @@ def test_pydantic_model() -> None: def test_non_get() -> None: with TestClient(app) as client: response = client.put("/cached_put") + assert response.status_code == HTTPStatus.METHOD_NOT_ALLOWED assert "X-FastAPI-Cache" not in response.headers - assert response.json() == {"value": 1} + assert response.json() != {"value": 1} response = client.put("/cached_put") + assert response.status_code == HTTPStatus.METHOD_NOT_ALLOWED assert "X-FastAPI-Cache" not in response.headers - assert response.json() == {"value": 2} + assert response.json() != {"value": 2} def test_alternate_injected_namespace() -> None: