Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiseck3 committed Dec 7, 2023
1 parent 57033a9 commit 63e03e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions test_unstructured_ingest/unit/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -40,8 +40,8 @@ class TestConfig(BaseConnectorConfig):


@dataclass
class TestIngestDoc(BaseSingleIngestDoc):
connector_config: TestConfig
class ExampleIngestDoc(BaseSingleIngestDoc):
connector_config: ExampleConfig

@property
def filename(self):
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand All @@ -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(
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions test_unstructured_ingest/unit/test_paths.py
Original file line number Diff line number Diff line change
@@ -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,
)

Expand Down

0 comments on commit 63e03e1

Please sign in to comment.