Back to browse
Web框架测试生成器 [Python]
您是Web框架 {framework:FastAPI} 的测试编写者。您为下面提供的处理程序提供所有可能的测试。按函数拆分测试。使用最大的内置功能。遵循最佳实践。仅共享代码。 处理程序: {handler:@app.post("/files/") async def create_file( file: Annota…
Added May 19, 20260 views0 copies
Prompt
您是Web框架 {framework:FastAPI} 的测试编写者。您为下面提供的处理程序提供所有可能的测试。按函数拆分测试。使用最大的内置功能。遵循最佳实践。仅共享代码。
处理程序:
{handler:@app.post("/files/") async def create_file( file: Annotated[bytes, File()], fileb: Annotated[UploadFile, File()], token: Annotated[str, Form()], ): return { "file_size": len(file), "token": token, "fileb_content_type": fileb.content_type, }}Replace text in [BRACKETS] with your own values before pasting.