mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
merge main
This commit is contained in:
@ -2,6 +2,8 @@ import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from core.variables import (
|
||||
ArrayFileVariable,
|
||||
ArrayVariable,
|
||||
FloatVariable,
|
||||
IntegerVariable,
|
||||
ObjectVariable,
|
||||
@ -81,3 +83,8 @@ def test_variable_to_object():
|
||||
assert var.to_object() == 3.14
|
||||
var = SecretVariable(name="secret", value="secret_value")
|
||||
assert var.to_object() == "secret_value"
|
||||
|
||||
|
||||
def test_array_file_variable_is_array_variable():
|
||||
var = ArrayFileVariable(name="files", value=[])
|
||||
assert isinstance(var, ArrayVariable)
|
||||
|
||||
@ -4,8 +4,8 @@ from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
from oss2 import Bucket
|
||||
from oss2.models import GetObjectResult, PutObjectResult
|
||||
from oss2 import Bucket # type: ignore
|
||||
from oss2.models import GetObjectResult, PutObjectResult # type: ignore
|
||||
|
||||
from tests.unit_tests.oss.__mock.base import (
|
||||
get_example_bucket,
|
||||
|
||||
@ -3,8 +3,8 @@ from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
from qcloud_cos import CosS3Client
|
||||
from qcloud_cos.streambody import StreamBody
|
||||
from qcloud_cos import CosS3Client # type: ignore
|
||||
from qcloud_cos.streambody import StreamBody # type: ignore
|
||||
|
||||
from tests.unit_tests.oss.__mock.base import (
|
||||
get_example_bucket,
|
||||
|
||||
@ -4,8 +4,8 @@ from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
from tos import TosClientV2
|
||||
from tos.clientv2 import DeleteObjectOutput, GetObjectOutput, HeadObjectOutput, PutObjectOutput
|
||||
from tos import TosClientV2 # type: ignore
|
||||
from tos.clientv2 import DeleteObjectOutput, GetObjectOutput, HeadObjectOutput, PutObjectOutput # type: ignore
|
||||
|
||||
from tests.unit_tests.oss.__mock.base import (
|
||||
get_example_bucket,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from oss2 import Auth
|
||||
from oss2 import Auth # type: ignore
|
||||
|
||||
from extensions.storage.aliyun_oss_storage import AliyunOssStorage
|
||||
from tests.unit_tests.oss.__mock.aliyun_oss import setup_aliyun_oss_mock
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from qcloud_cos import CosConfig
|
||||
from qcloud_cos import CosConfig # type: ignore
|
||||
|
||||
from extensions.storage.tencent_cos_storage import TencentCosStorage
|
||||
from tests.unit_tests.oss.__mock.base import (
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from tos import TosClientV2
|
||||
from tos import TosClientV2 # type: ignore
|
||||
|
||||
from extensions.storage.volcengine_tos_storage import VolcengineTosStorage
|
||||
from tests.unit_tests.oss.__mock.base import (
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from textwrap import dedent
|
||||
|
||||
import pytest
|
||||
from yaml import YAMLError
|
||||
from yaml import YAMLError # type: ignore
|
||||
|
||||
from core.tools.utils.yaml_utils import load_yaml_file
|
||||
|
||||
|
||||
Reference in New Issue
Block a user