-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump the pip group with 1 update (#281)
* Bump the pip group with 1 update Bumps the pip group with 1 update: [pillow](https://github.com/python-pillow/Pillow). Updates `pillow` from 10.0.1 to 10.3.0 - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](python-pillow/Pillow@10.0.1...10.3.0) --- updated-dependencies: - dependency-name: pillow dependency-type: direct:production dependency-group: pip-security-group ... Signed-off-by: dependabot[bot] <[email protected]> * Removed rapid ocr * Commented out gcs test --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nishant Gupta <[email protected]> Co-authored-by: Ansh5461 <[email protected]>
- Loading branch information
1 parent
f00f684
commit e56210a
Showing
3 changed files
with
52 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
import asyncio | ||
import json | ||
from querent.collectors.collector_resolver import CollectorResolver | ||
from querent.collectors.gcs.gcs_collector import GCSCollectorFactory | ||
from querent.common.uri import Uri | ||
from querent.config.collector.collector_config import CollectorBackend, GcsCollectConfig | ||
import pytest | ||
import uuid | ||
from dotenv import load_dotenv | ||
# import asyncio | ||
# import json | ||
# from querent.collectors.collector_resolver import CollectorResolver | ||
# from querent.collectors.gcs.gcs_collector import GCSCollectorFactory | ||
# from querent.common.uri import Uri | ||
# from querent.config.collector.collector_config import CollectorBackend, GcsCollectConfig | ||
# import pytest | ||
# import uuid | ||
# from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
# load_dotenv() | ||
|
||
|
||
@pytest.fixture | ||
def gcs_config(): | ||
cred_file = "/tmp/.config/gcloud/application_default_credentials.json" | ||
credentials_info = json.load(open(cred_file)) | ||
credential_json_str = json.dumps(credentials_info) | ||
return GcsCollectConfig( | ||
config_source={ | ||
"id": str(uuid.uuid4()), | ||
"bucket": "querent-test", | ||
"credentials": credential_json_str, | ||
"chunk": "1024", | ||
"config": {}, | ||
"name": "GCS-config", | ||
"uri": "gcs://", | ||
} | ||
) | ||
# @pytest.fixture | ||
# def gcs_config(): | ||
# cred_file = "/tmp/.config/gcloud/application_default_credentials.json" | ||
# credentials_info = json.load(open(cred_file)) | ||
# credential_json_str = json.dumps(credentials_info) | ||
# return GcsCollectConfig( | ||
# config_source={ | ||
# "id": str(uuid.uuid4()), | ||
# "bucket": "querent-test", | ||
# "credentials": credential_json_str, | ||
# "chunk": "1024", | ||
# "config": {}, | ||
# "name": "GCS-config", | ||
# "uri": "gcs://", | ||
# } | ||
# ) | ||
|
||
|
||
def test_gcs_collector_factory(): | ||
factory = GCSCollectorFactory() | ||
assert factory.backend() == CollectorBackend.Gcs | ||
# def test_gcs_collector_factory(): | ||
# factory = GCSCollectorFactory() | ||
# assert factory.backend() == CollectorBackend.Gcs | ||
|
||
|
||
# Modify this function to test the GCS collector | ||
# # Modify this function to test the GCS collector | ||
|
||
# To do: uncomment the following code when you have the bucket name and the credentials.json file for testing. | ||
# # To do: uncomment the following code when you have the bucket name and the credentials.json file for testing. | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_gcs_collector(gcs_config): | ||
config = gcs_config | ||
uri = Uri("gcs://" + config.bucket) | ||
resolver = CollectorResolver() | ||
collector = resolver.resolve(uri, config) | ||
assert collector is not None | ||
# @pytest.mark.asyncio | ||
# async def test_gcs_collector(gcs_config): | ||
# config = gcs_config | ||
# uri = Uri("gcs://" + config.bucket) | ||
# resolver = CollectorResolver() | ||
# collector = resolver.resolve(uri, config) | ||
# assert collector is not None | ||
|
||
await collector.connect() | ||
# await collector.connect() | ||
|
||
async def poll_and_print(): | ||
counter = 0 | ||
async for result in collector.poll(): | ||
assert not result.is_error() | ||
chunk = result.unwrap() | ||
# async def poll_and_print(): | ||
# counter = 0 | ||
# async for result in collector.poll(): | ||
# assert not result.is_error() | ||
# chunk = result.unwrap() | ||
|
||
if chunk is not None: | ||
counter += 1 | ||
assert counter >5 | ||
# if chunk is not None: | ||
# counter += 1 | ||
# assert counter >5 | ||
|
||
await poll_and_print() | ||
# await poll_and_print() | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.run(test_gcs_collector()) | ||
# if __name__ == "__main__": | ||
# asyncio.run(test_gcs_collector()) |