feat: add temporal context and contextual help
This commit is contained in:
@@ -48,6 +48,10 @@ class ConditionalRequestTests(unittest.TestCase):
|
||||
self.assertIn("private", first.headers.get("cache-control", ""))
|
||||
self.assertIn("no-cache", first.headers.get("cache-control", ""))
|
||||
self.assertIn("authorization", first.headers.get("vary", "").lower())
|
||||
self.assertIn(
|
||||
"x-govoplan-validity-mode",
|
||||
first.headers.get("vary", "").lower(),
|
||||
)
|
||||
self.assertEqual("request-1", first.headers["X-Correlation-ID"])
|
||||
|
||||
second = client.get("/json", headers={"If-None-Match": etag or "", "X-Request-ID": "request-2"})
|
||||
@@ -56,6 +60,20 @@ class ConditionalRequestTests(unittest.TestCase):
|
||||
self.assertEqual(etag, second.headers.get("etag"))
|
||||
self.assertEqual("request-2", second.headers["X-Correlation-ID"])
|
||||
|
||||
historical = client.get(
|
||||
"/json",
|
||||
headers={
|
||||
"X-Govoplan-Validity-Mode": "at",
|
||||
"X-Govoplan-Valid-At": "2025-02-03T10:30:00Z",
|
||||
},
|
||||
)
|
||||
self.assertEqual(200, historical.status_code, historical.text)
|
||||
self.assertEqual("at", historical.headers["X-Govoplan-Validity-Mode"])
|
||||
self.assertIn(
|
||||
"x-govoplan-valid-at",
|
||||
historical.headers.get("vary", "").lower(),
|
||||
)
|
||||
|
||||
def test_changed_json_body_does_not_match_previous_etag(self) -> None:
|
||||
with self._client() as client:
|
||||
first = client.get("/json?value=alpha")
|
||||
|
||||
Reference in New Issue
Block a user