File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
backend/app/tests/api/routes/documents Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 33from urllib .parse import urlparse
44
55import pytest
6+ from botocore .exceptions import ClientError
67from moto import mock_aws
78from sqlmodel import Session , select
89
1617 DocumentMaker ,
1718 Route ,
1819 WebCrawler ,
20+ crawler ,
1921)
22+ from app .tests .utils .utils import openai_credentials
2023
2124
2225@pytest .fixture
@@ -66,6 +69,13 @@ def test_permanently_deletes_document_from_db_and_s3(
6669 assert doc_in_db is not None
6770 assert doc_in_db .deleted_at is not None
6871
72+ with pytest .raises (ClientError ) as exc_info :
73+ aws .client .head_object (
74+ Bucket = settings .AWS_S3_BUCKET ,
75+ Key = str (s3_key ),
76+ )
77+ assert exc_info .value .response ["Error" ]["Code" ] == "404"
78+
6979 @openai_responses .mock ()
7080 def test_cannot_delete_nonexistent_document (
7181 self ,
You can’t perform that action at this time.
0 commit comments