From 63e03e18de1938cbcaa0e38c6c67d1930070cfc3 Mon Sep 17 00:00:00 2001 From: Roman Isecke Date: Thu, 7 Dec 2023 10:36:39 -0500 Subject: [PATCH] fix unit tests --- .../unit/test_interfaces.py | 18 +++++++++--------- test_unstructured_ingest/unit/test_paths.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test_unstructured_ingest/unit/test_interfaces.py b/test_unstructured_ingest/unit/test_interfaces.py index b51dac689e..6d8a513033 100644 --- a/test_unstructured_ingest/unit/test_interfaces.py +++ b/test_unstructured_ingest/unit/test_interfaces.py @@ -25,12 +25,12 @@ @dataclass -class TestConfig(BaseConnectorConfig): +class ExampleConfig(BaseConnectorConfig): id: str path: str -TEST_CONFIG = TestConfig(id=TEST_ID, path=TEST_FILE_PATH) +TEST_CONFIG = ExampleConfig(id=TEST_ID, path=TEST_FILE_PATH) TEST_SOURCE_URL = "test-source-url" TEST_VERSION = "1.1.1" TEST_RECORD_LOCATOR = {"id": "data-source-id"} @@ -40,8 +40,8 @@ class TestConfig(BaseConnectorConfig): @dataclass -class TestIngestDoc(BaseSingleIngestDoc): - connector_config: TestConfig +class ExampleIngestDoc(BaseSingleIngestDoc): + connector_config: ExampleConfig @property def filename(self): @@ -114,7 +114,7 @@ def partition_file_test_results(partition_test_results): def test_partition_file(): """Validate partition_file returns a list of dictionaries with the expected keys, metadatakeys, and data source metadata values.""" - test_ingest_doc = TestIngestDoc( + test_ingest_doc = ExampleIngestDoc( connector_config=TEST_CONFIG, read_config=ReadConfig(download_dir=TEST_DOWNLOAD_DIR), processor_config=ProcessorConfig(output_dir=TEST_OUTPUT_DIR), @@ -161,7 +161,7 @@ def test_process_file_fields_include_default(mocker, partition_test_results): "unstructured.ingest.interfaces.partition", return_value=partition_test_results, ) - test_ingest_doc = TestIngestDoc( + test_ingest_doc = ExampleIngestDoc( connector_config=TEST_CONFIG, read_config=ReadConfig(download_dir=TEST_DOWNLOAD_DIR), processor_config=ProcessorConfig(output_dir=TEST_OUTPUT_DIR), @@ -197,7 +197,7 @@ def test_process_file_metadata_includes_filename_and_filetype( partition_config = PartitionConfig( metadata_include=["filename", "filetype"], ) - test_ingest_doc = TestIngestDoc( + test_ingest_doc = ExampleIngestDoc( connector_config=TEST_CONFIG, read_config=ReadConfig(download_dir=TEST_DOWNLOAD_DIR), processor_config=ProcessorConfig(output_dir=TEST_OUTPUT_DIR), @@ -221,7 +221,7 @@ def test_process_file_metadata_exclude_filename_pagenum(mocker, partition_test_r partition_config = PartitionConfig( metadata_exclude=["filename", "page_number"], ) - test_ingest_doc = TestIngestDoc( + test_ingest_doc = ExampleIngestDoc( connector_config=TEST_CONFIG, read_config=ReadConfig(download_dir=TEST_DOWNLOAD_DIR), processor_config=ProcessorConfig( @@ -244,7 +244,7 @@ def test_process_file_flatten_metadata(mocker, partition_test_results): metadata_include=["filename", "file_directory", "filetype"], flatten_metadata=True, ) - test_ingest_doc = TestIngestDoc( + test_ingest_doc = ExampleIngestDoc( connector_config=TEST_CONFIG, read_config=ReadConfig(download_dir=TEST_DOWNLOAD_DIR), processor_config=ProcessorConfig( diff --git a/test_unstructured_ingest/unit/test_paths.py b/test_unstructured_ingest/unit/test_paths.py index b790edfa2a..73915b30cb 100644 --- a/test_unstructured_ingest/unit/test_paths.py +++ b/test_unstructured_ingest/unit/test_paths.py @@ -1,10 +1,10 @@ from dataclasses import dataclass from pathlib import Path -from unstructured.ingest.connector.dropbox import ( +from unstructured.ingest.connector.fsspec.dropbox import ( DropboxIngestDoc, ) -from unstructured.ingest.connector.fsspec import ( +from unstructured.ingest.connector.fsspec.fsspec import ( FsspecIngestDoc, )