test_background_dispatch_api.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. """Integration tests for removed direct print API behavior."""
  2. import pytest
  3. from httpx import AsyncClient
  4. class TestLegacyArchivePrintAPI:
  5. """Tests for the removed archive reprint dispatch endpoint."""
  6. @pytest.mark.asyncio
  7. @pytest.mark.integration
  8. async def test_reprint_route_returns_410_and_does_not_dispatch(self, async_client: AsyncClient):
  9. """Legacy direct reprint endpoint is gone; callers must create queue items."""
  10. response = await async_client.post(
  11. "/api/v1/archives/123/reprint?printer_id=456",
  12. json={"plate_id": 2},
  13. )
  14. assert response.status_code == 410
  15. assert "POST /queue/" in response.json()["detail"]
  16. class TestLegacyLibraryPrintAPI:
  17. """Tests for the removed library print dispatch endpoint."""
  18. @pytest.mark.asyncio
  19. @pytest.mark.integration
  20. async def test_library_print_route_returns_410_and_does_not_dispatch(self, async_client: AsyncClient):
  21. """Legacy direct library print endpoint is gone; callers must create queue items."""
  22. response = await async_client.post(
  23. "/api/v1/library/files/123/print?printer_id=456",
  24. json={"plate_id": 4},
  25. )
  26. assert response.status_code == 410
  27. assert "POST /queue/" in response.json()["detail"]