improved tests - fixing the linting
This commit is contained in:
@@ -1,10 +1,8 @@
|
|||||||
"""Integration tests for Unstructured API functionality."""
|
"""Integration tests for Unstructured API functionality."""
|
||||||
|
|
||||||
import base64
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Any, Dict
|
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
"""Unit tests for Unstructured API configuration."""
|
"""Unit tests for Unstructured API configuration."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from nextcloud_mcp_server.config import (
|
|
||||||
get_unstructured_strategy,
|
|
||||||
get_unstructured_languages,
|
|
||||||
)
|
|
||||||
from nextcloud_mcp_server.client.unstructured_client import UnstructuredClient
|
from nextcloud_mcp_server.client.unstructured_client import UnstructuredClient
|
||||||
|
from nextcloud_mcp_server.config import (
|
||||||
|
get_unstructured_languages,
|
||||||
|
get_unstructured_strategy,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestUnstructuredStrategy:
|
class TestUnstructuredStrategy:
|
||||||
@@ -134,7 +135,7 @@ class TestUnstructuredClientConfiguration:
|
|||||||
os.environ["UNSTRUCTURED_API_URL"] = "http://test:8000"
|
os.environ["UNSTRUCTURED_API_URL"] = "http://test:8000"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client = UnstructuredClient()
|
_client = UnstructuredClient()
|
||||||
# The partition_document method should use get_unstructured_strategy() when strategy is None
|
# The partition_document method should use get_unstructured_strategy() when strategy is None
|
||||||
# We can't test the actual call without a running API, but we can verify the config is read
|
# We can't test the actual call without a running API, but we can verify the config is read
|
||||||
assert get_unstructured_strategy() == "auto"
|
assert get_unstructured_strategy() == "auto"
|
||||||
@@ -148,7 +149,7 @@ class TestUnstructuredClientConfiguration:
|
|||||||
os.environ["UNSTRUCTURED_API_URL"] = "http://test:8000"
|
os.environ["UNSTRUCTURED_API_URL"] = "http://test:8000"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client = UnstructuredClient()
|
_client = UnstructuredClient()
|
||||||
# The partition_document method should use get_unstructured_languages() when languages is None
|
# The partition_document method should use get_unstructured_languages() when languages is None
|
||||||
assert get_unstructured_languages() == ["eng", "deu"]
|
assert get_unstructured_languages() == ["eng", "deu"]
|
||||||
finally:
|
finally:
|
||||||
@@ -162,7 +163,7 @@ class TestUnstructuredClientConfiguration:
|
|||||||
os.environ["UNSTRUCTURED_API_URL"] = "http://test:8000"
|
os.environ["UNSTRUCTURED_API_URL"] = "http://test:8000"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client = UnstructuredClient()
|
_client = UnstructuredClient()
|
||||||
assert get_unstructured_strategy() == "hi_res"
|
assert get_unstructured_strategy() == "hi_res"
|
||||||
assert get_unstructured_languages() == ["eng", "fra", "spa"]
|
assert get_unstructured_languages() == ["eng", "fra", "spa"]
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in New Issue
Block a user