/
githubmirror
/
salt
Обзор
Документация
Войти
/
githubmirror
/
salt
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/pytests/unit/test_config.py
35 строк
872 B
vzhestkov
Remove optimization_order from tests
30 янв 2026, 08:17
30 янв 2026, 08:17
be77f90
Код
Авторство
О чём код?
""" tests.pytests.unit.test_config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unit tests for salt's config modulet """ import pathlib import salt.config import salt.syspaths def test_call_id_function(tmp_path): "Defining id_function works as expected" cache_dir = tmp_path / "cache" extmods = tmp_path / "extmods" opts = { "id_function": {"grains.get": {"key": "osfinger"}}, "cachedir": str(cache_dir), "extension_modules": str(extmods), "grains": {"osfinger": "meh"}, } ret = salt.config.call_id_function(opts) assert ret == "meh" def test_prepend_root_dir(tmp_path): root = tmp_path / "root" opts = { "root_dir": root, "foo": str(pathlib.Path(salt.syspaths.ROOT_DIR) / "var" / "foo"), } salt.config.prepend_root_dir(opts, ["foo"]) assert opts["foo"] == str(root / "var" / "foo")