Deletes a specific test file.
(app_name: str, test_name: str)
| 672 | |
| 673 | @app.delete("/dev/apps/{app_name}/tests/{test_name}") |
| 674 | async def delete_test(app_name: str, test_name: str) -> dict[str, str]: |
| 675 | """Deletes a specific test file.""" |
| 676 | agent_dir = os.path.join(self.agents_dir, app_name) |
| 677 | tests_dir = os.path.join(agent_dir, "tests") |
| 678 | |
| 679 | if not test_name.endswith(".json"): |
| 680 | test_name += ".json" |
| 681 | |
| 682 | test_file_path = os.path.join(tests_dir, test_name) |
| 683 | |
| 684 | if not os.path.exists(test_file_path): |
| 685 | raise HTTPException(status_code=404, detail="Test file not found") |
| 686 | |
| 687 | os.remove(test_file_path) |
| 688 | return {"status": "success"} |
| 689 | |
| 690 | @app.get("/dev/apps/{app_name}/tests/{test_name}") |
| 691 | async def get_test_content(app_name: str, test_name: str) -> dict[str, Any]: |