You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
750 B
21 lines
750 B
import pytest
|
|
import configspec
|
|
from copy import deepcopy
|
|
from test_configspec import example_spec, example_values
|
|
|
|
|
|
def test_man(example_spec, example_values):
|
|
confman = configspec.ConfigManager()
|
|
confman.add_confspec("test_bundle", example_spec)
|
|
confman.load({"test_bundle": example_values})
|
|
assert confman.get_config_bundle("test_bundle") == example_values
|
|
|
|
confman.freeze_value("test_bundle", "int_a")
|
|
newvals = deepcopy(example_values)
|
|
newvals["int_a"] = 4
|
|
|
|
confman.load({"test_bundle": newvals})
|
|
assert confman.get_config_bundle("test_bundle") == example_values
|
|
confman.load_overlay({"test_bundle": {"string_a": "new text"}})
|
|
assert confman.get_config_bundle("test_bundle")["string_a"] == "new text"
|