Skip to content

Commit 934316a

Browse files
committed
fix unit test
1 parent e779b3e commit 934316a

File tree

2 files changed

+34
-33
lines changed

2 files changed

+34
-33
lines changed

test/test_schema.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -449,22 +449,16 @@ def fn(a: FileData) -> list[FileData]:
449449
"identifier": {"type": "string"},
450450
"connector_type": {"type": "string"},
451451
"source_identifiers": {
452-
"anyOf": [
453-
{
454-
"type": "object",
455-
"properties": {
456-
"filename": {"type": "string"},
457-
"fullpath": {"type": "string"},
458-
"rel_path": {
459-
"anyOf": [{"type": "string"}, {"type": "null"}],
460-
"default": None,
461-
},
462-
},
463-
"required": ["filename", "fullpath"],
452+
"type": "object",
453+
"properties": {
454+
"filename": {"type": "string"},
455+
"fullpath": {"type": "string"},
456+
"rel_path": {
457+
"anyOf": [{"type": "string"}, {"type": "null"}],
458+
"default": None,
464459
},
465-
{"type": "null"},
466-
],
467-
"default": None,
460+
},
461+
"required": ["filename", "fullpath"],
468462
},
469463
"metadata": {
470464
"type": "object",
@@ -533,7 +527,13 @@ def fn(a: FileData) -> list[FileData]:
533527
"default": None,
534528
},
535529
},
536-
"required": ["identifier", "connector_type", "metadata", "additional_metadata"],
530+
"required": [
531+
"identifier",
532+
"connector_type",
533+
"source_identifiers",
534+
"metadata",
535+
"additional_metadata",
536+
],
537537
}
538538
},
539539
}
@@ -551,22 +551,16 @@ def fn(a: FileData) -> list[FileData]:
551551
"identifier": {"type": "string"},
552552
"connector_type": {"type": "string"},
553553
"source_identifiers": {
554-
"anyOf": [
555-
{
556-
"type": "object",
557-
"properties": {
558-
"filename": {"type": "string"},
559-
"fullpath": {"type": "string"},
560-
"rel_path": {
561-
"anyOf": [{"type": "string"}, {"type": "null"}],
562-
"default": None,
563-
},
564-
},
565-
"required": ["filename", "fullpath"],
554+
"type": "object",
555+
"properties": {
556+
"filename": {"type": "string"},
557+
"fullpath": {"type": "string"},
558+
"rel_path": {
559+
"anyOf": [{"type": "string"}, {"type": "null"}],
560+
"default": None,
566561
},
567-
{"type": "null"},
568-
],
569-
"default": None,
562+
},
563+
"required": ["filename", "fullpath"],
570564
},
571565
"metadata": {
572566
"type": "object",
@@ -629,7 +623,13 @@ def fn(a: FileData) -> list[FileData]:
629623
},
630624
"display_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": None},
631625
},
632-
"required": ["identifier", "connector_type", "metadata", "additional_metadata"],
626+
"required": [
627+
"identifier",
628+
"connector_type",
629+
"source_identifiers",
630+
"metadata",
631+
"additional_metadata",
632+
],
633633
},
634634
}
635635

test/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66
from pydantic import BaseModel
7-
from unstructured_ingest.v2.interfaces import FileData
7+
from unstructured_ingest.v2.interfaces import FileData, SourceIdentifiers
88
from uvicorn.importer import import_from_string
99

1010
from unstructured_platform_plugins.etl_uvicorn import utils
@@ -110,6 +110,7 @@ def fn(a: A, b: B, c: MyEnum, d: list, e: FileData) -> None:
110110
identifier="custom_file_data",
111111
connector_type="mock_connector",
112112
additional_metadata={"additional": "metadata"},
113+
source_identifiers=SourceIdentifiers(filename="file.txt", fullpath="file.txt"),
113114
)
114115
inputs = {
115116
"a": {"b": 4, "c": 5.6},

0 commit comments

Comments
 (0)