Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

826 B
Raw Blame
from collections.abc import Callable
from unittest.mock import patch

import pytest

from enums import DeploymentEdition
from services.feature_service import FeatureService


@pytest.mark.parametrize(
    ("edition", "centrally_managed"),
    [
        (DeploymentEdition.COMMUNITY, False),
        (DeploymentEdition.CLOUD, False),
        (DeploymentEdition.ENTERPRISE, True),
    ],
)
def test_workspace_features_report_im_management_mode(
    config_overrides: Callable[..., None], edition: DeploymentEdition, centrally_managed: bool
) -> None:
    config_overrides(DEPLOYMENT_EDITION=edition)
    with patch("services.feature_service.EnterpriseService.get_workspace_info", return_value={}):
        features = FeatureService.get_features("")

    assert features.model_dump()["im_centrally_managed"] is centrally_managed