mirror of
https://github.com/langgenius/dify.git
synced 2026-09-29 17:07:38 +08:00
test: clarify container boundaries for storage and Redis (#40714)
This commit is contained in:
+4
@@ -3,9 +3,13 @@
|
||||
import json
|
||||
from uuid import uuid4
|
||||
|
||||
import pytest
|
||||
|
||||
from extensions.ext_redis import redis_client
|
||||
from services.enterprise.account_deletion_sync import _queue_task
|
||||
|
||||
pytestmark = pytest.mark.usefixtures("set_up_containers_and_env")
|
||||
|
||||
|
||||
def test_queue_task_success() -> None:
|
||||
workspace_id = str(uuid4())
|
||||
|
||||
+5
-3
@@ -1,3 +1,5 @@
|
||||
"""Unit coverage for OpenDAL filesystem root selection."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -8,7 +10,7 @@ from extensions.storage.opendal_storage import OpenDALStorage
|
||||
class TestOpenDALFsDefaultRoot:
|
||||
"""Test that OpenDALStorage with scheme='fs' works correctly when no root is provided."""
|
||||
|
||||
def test_fs_without_root_uses_default(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
def test_fs_without_root_uses_default(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""When no root is specified, the default 'storage' should be used and passed to the Operator."""
|
||||
# Change to tmp_path so the default "storage" dir is created there
|
||||
monkeypatch.chdir(tmp_path)
|
||||
@@ -27,7 +29,7 @@ class TestOpenDALFsDefaultRoot:
|
||||
# Cleanup
|
||||
storage.delete("test_default_root.txt")
|
||||
|
||||
def test_fs_with_explicit_root(self, tmp_path: Path):
|
||||
def test_fs_with_explicit_root(self, tmp_path: Path) -> None:
|
||||
"""When root is explicitly provided, it should be used."""
|
||||
custom_root = str(tmp_path / "custom_storage")
|
||||
storage = OpenDALStorage(scheme="fs", root=custom_root)
|
||||
@@ -40,7 +42,7 @@ class TestOpenDALFsDefaultRoot:
|
||||
# Cleanup
|
||||
storage.delete("test_explicit_root.txt")
|
||||
|
||||
def test_fs_with_env_var_root(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
|
||||
def test_fs_with_env_var_root(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""When OPENDAL_FS_ROOT env var is set, it should be picked up via _get_opendal_kwargs."""
|
||||
env_root = str(tmp_path / "env_storage")
|
||||
monkeypatch.setenv("OPENDAL_FS_ROOT", env_root)
|
||||
Reference in New Issue
Block a user