Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ots/llm/pdf-to-markdown
1 result
Show changes
import pytest
from fastapi.testclient import TestClient
from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY
from service.core.settings import settings
from service.main import app
client = TestClient(app)
@pytest.mark.integration
def test_create_conversion_returns_result():
response = client.post(
"/conversions",
json={
"source_url": f"{settings.S3_ENDPOINT}/{settings.S3_BUCKET}/my-fake-file",
},
)
assert response.json() == {
"id": 1,
"result_url": None,
"source_url": "https://s3.us-west-002.backblazeb2.com/lfc-llm-pdf-dev/my-fake-file",
"status": "pending",
}
@pytest.mark.integration
def test_create_conversion_with_bad_source_returns_422():
response = client.post(
"/conversions",
json={
"source_url": f"not-the-endpoint-{settings.S3_ENDPOINT}/{settings.S3_BUCKET}/my-fake-file",
},
)
assert response.status_code == HTTP_422_UNPROCESSABLE_ENTITY
import pytest
from fastapi.testclient import TestClient
from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY, HTTP_200_OK
from starlette.status import HTTP_200_OK, HTTP_422_UNPROCESSABLE_ENTITY
from service.core.settings import settings
from service.main import app
......@@ -38,6 +38,9 @@ def test_create_presigned_post_returns_boto3_result(mocker):
}
@pytest.mark.filterwarnings(
"ignore:datetime.datetime.utcnow"
) # See https://github.com/boto/boto3/issues/3889
@pytest.mark.integration
def test_create_presigned_post_properly_intgrates_with_boto3():
response = client.post(
......