mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 04:14:42 +00:00
Batch fixes 2
This commit is contained in:
1 parent
47eb92fc42
commit
ed0892b39b
30 files changed
+619
-112
No files matched your search
@@ -903,3 +903,14 @@ class TestSSRFValidation:
|
||||
with pytest.raises(ValueError, match="Invalid S3 endpoint_url"):
|
||||
s3_loader.load_data(input_data)
|
||||
mock_boto3.client.assert_not_called()
|
||||
|
||||
|
||||
def test_is_supported_document_follows_the_upload_whitelist():
|
||||
from application.parser.file.constants import SUPPORTED_SOURCE_DOCUMENT_EXTENSIONS
|
||||
from application.parser.remote.s3_loader import S3Loader
|
||||
|
||||
for suffix in SUPPORTED_SOURCE_DOCUMENT_EXTENSIONS:
|
||||
key = f"bucket/file{suffix}"
|
||||
assert S3Loader.is_text_file(None, key) or S3Loader.is_supported_document(None, key), suffix
|
||||
assert S3Loader.is_supported_document(None, "bucket/file.doc")
|
||||
assert not S3Loader.is_supported_document(None, "bucket/file.exe")
|
||||
Reference in new issue
Block a user