|
@@ -15,6 +15,7 @@ def example_env_file(tmp_path, monkeypatch) -> str:
|
|
|
file_path.write_text(dedent(
|
|
|
"""
|
|
|
CONSOLE_API_URL=https://example.com
|
|
|
+ CONSOLE_WEB_URL=https://example.com
|
|
|
"""))
|
|
|
return str(file_path)
|
|
|
|
|
@@ -47,14 +48,13 @@ def test_flask_configs(example_env_file):
|
|
|
flask_app.config.from_mapping(DifyConfig(_env_file=example_env_file).model_dump())
|
|
|
config = flask_app.config
|
|
|
|
|
|
- # configs read from dotenv directly
|
|
|
- assert config['LOG_LEVEL'] == 'INFO'
|
|
|
-
|
|
|
# configs read from pydantic-settings
|
|
|
+ assert config['LOG_LEVEL'] == 'INFO'
|
|
|
assert config['COMMIT_SHA'] == ''
|
|
|
assert config['EDITION'] == 'SELF_HOSTED'
|
|
|
assert config['API_COMPRESSION_ENABLED'] is False
|
|
|
assert config['SENTRY_TRACES_SAMPLE_RATE'] == 1.0
|
|
|
+ assert config['TESTING'] == False
|
|
|
|
|
|
# value from env file
|
|
|
assert config['CONSOLE_API_URL'] == 'https://example.com'
|
|
@@ -71,3 +71,7 @@ def test_flask_configs(example_env_file):
|
|
|
'pool_recycle': 3600,
|
|
|
'pool_size': 30,
|
|
|
}
|
|
|
+
|
|
|
+ assert config['CONSOLE_WEB_URL']=='https://example.com'
|
|
|
+ assert config['CONSOLE_CORS_ALLOW_ORIGINS']==['https://example.com']
|
|
|
+ assert config['WEB_API_CORS_ALLOW_ORIGINS'] == ['*']
|