Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pdf-to-markdown
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
LLM
pdf-to-markdown
Compare revisions
b16888eaf2381a6a25e4481694936214a1ca69bd to 9370c1f409ff8895dd259463945282a016c1e597
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
ots/llm/pdf-to-markdown
Select target project
No results found
9370c1f409ff8895dd259463945282a016c1e597
Select Git revision
Branches
5-add-conversion-job
main
Swap
Target
ots/llm/pdf-to-markdown
Select target project
ots/llm/pdf-to-markdown
1 result
b16888eaf2381a6a25e4481694936214a1ca69bd
Select Git revision
Branches
5-add-conversion-job
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_conversions.py
+36
-0
36 additions, 0 deletions
tests/test_conversions.py
tests/test_presigned_posts.py
+4
-1
4 additions, 1 deletion
tests/test_presigned_posts.py
with
40 additions
and
1 deletion
tests/test_conversions.py
0 → 100644
View file @
9370c1f4
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
This diff is collapsed.
Click to expand it.
tests/test_presigned_posts.py
View file @
9370c1f4
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
(
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next