File: json-format.patch

package info (click to toggle)
starlette 0.46.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,936 kB
  • sloc: python: 13,029; sh: 101; makefile: 6
file content (45 lines) | stat: -rw-r--r-- 1,937 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: Bas Couwenberg <sebastic@debian.org>
Date: Mon, 28 Jul 2025 11:40:09 +0200
Subject: Fix test failures with older dependencies in testing.

Bug-Debian: https://bugs.debian.org/1100087
---
 tests/middleware/test_wsgi.py | 2 +-
 tests/test_requests.py        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/middleware/test_wsgi.py b/tests/middleware/test_wsgi.py
index 3511c89..41fc0ae 100644
--- a/tests/middleware/test_wsgi.py
+++ b/tests/middleware/test_wsgi.py
@@ -78,7 +78,7 @@ def test_wsgi_post(test_client_factory: TestClientFactory) -> None:
     client = test_client_factory(app)
     response = client.post("/", json={"example": 123})
     assert response.status_code == 200
-    assert response.text == '{"example":123}'
+    assert response.text in ['{"example":123}', '{"example": 123}']
 
 
 def test_wsgi_exception(test_client_factory: TestClientFactory) -> None:
diff --git a/tests/test_requests.py b/tests/test_requests.py
index 7e2c608..8f71d26 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -92,7 +92,7 @@ def test_request_body(test_client_factory: TestClientFactory) -> None:
     assert response.json() == {"body": ""}
 
     response = client.post("/", json={"a": "123"})
-    assert response.json() == {"body": '{"a":"123"}'}
+    assert response.json() in [{"body": '{"a":"123"}'}, {'body': '{"a": "123"}'}]
 
     response = client.post("/", data="abc")  # type: ignore
     assert response.json() == {"body": "abc"}
@@ -113,7 +113,7 @@ def test_request_stream(test_client_factory: TestClientFactory) -> None:
     assert response.json() == {"body": ""}
 
     response = client.post("/", json={"a": "123"})
-    assert response.json() == {"body": '{"a":"123"}'}
+    assert response.json() in [{"body": '{"a":"123"}'}, {'body': '{"a": "123"}'}]
 
     response = client.post("/", data="abc")  # type: ignore
     assert response.json() == {"body": "abc"}