mirror of
https://github.com/n8n-io/n8n.git
synced 2026-09-01 15:47:41 +08:00
95a81ed219
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
20 lines
681 B
Python
20 lines
681 B
Python
import os
|
|
from unittest.mock import patch
|
|
|
|
from src.config.task_runner_config import TaskRunnerConfig
|
|
from src.constants import ENV_ALLOW_TRANSITIVE_IMPORTS, ENV_GRANT_TOKEN
|
|
|
|
|
|
class TestAllowTransitiveImports:
|
|
def test_defaults_to_false(self):
|
|
with patch.dict(os.environ, {ENV_GRANT_TOKEN: "t"}, clear=True):
|
|
assert TaskRunnerConfig.from_env().allow_transitive_imports is False
|
|
|
|
def test_reads_true_from_env(self):
|
|
with patch.dict(
|
|
os.environ,
|
|
{ENV_GRANT_TOKEN: "t", ENV_ALLOW_TRANSITIVE_IMPORTS: "true"},
|
|
clear=True,
|
|
):
|
|
assert TaskRunnerConfig.from_env().allow_transitive_imports is True
|