test_file.py 523 B

123456789101112131415
  1. from pathlib import Path
  2. from fastapi.testclient import TestClient
  3. from mocka.main import get_application
  4. from mocka.configuration import Configuration, Server
  5. client = TestClient(get_application(Configuration(Server("localhost", 8585))))
  6. def test_post_octiva():
  7. file_path = Path("octiva/rails_0.jpg")
  8. response = client.get(f"/files/{file_path}")
  9. assert response.status_code == 200
  10. # temp_image_loc = Path(__file__).parent / Path("rail_image_test.jpg")
  11. # temp_image_loc.write_bytes(response.content)