incorporeal-cms/tests/test_factory.py
Brian S. Stephan 76b1800155
static site generator part 6 --- start testing stuff
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2025-03-15 14:20:15 -05:00

24 lines
774 B
Python

"""Test basic configuration stuff.
SPDX-FileCopyrightText: © 2020 Brian S. Stephan <bss@incorporeal.org>
SPDX-License-Identifier: AGPL-3.0-or-later
"""
import os
from incorporealcms import init_instance
from incorporealcms.config import Config
HERE = os.path.dirname(os.path.abspath(__file__))
def test_config():
"""Test that the app initialization sets values not normally present in the config."""
assert not getattr(Config, 'INSTANCE_VALUE', None)
assert not getattr(Config, 'EXTRA_VALUE', None)
instance_path = os.path.join(HERE, 'instance')
init_instance(instance_path=instance_path, extra_config={"EXTRA_VALUE": "hello"})
assert getattr(Config, 'INSTANCE_VALUE', None) == "hi"
assert getattr(Config, 'EXTRA_VALUE', None) == "hello"