()
| 255 | |
| 256 | |
| 257 | async def test_data() -> None: |
| 258 | app = Quart(__name__) |
| 259 | |
| 260 | @app.route("/", methods=["POST"]) |
| 261 | async def echo() -> str: |
| 262 | data = await request.get_data(as_text=True) |
| 263 | return data # type: ignore |
| 264 | |
| 265 | client = Client(app) |
| 266 | headers = {"Content-Type": "application/octet-stream"} |
| 267 | response = await client.post("/", data=b"ABCDEFG", headers=headers) |
| 268 | assert (await response.get_data(as_text=False)) == b"ABCDEFG" |
| 269 | |
| 270 | |
| 271 | async def test_query_string() -> None: |