Add basic unit test for prepend_root_dir method

This commit is contained in:
Daniel A. Wozniak 2024-06-22 08:20:29 -07:00 committed by Daniel Wozniak
parent dfd6221cc5
commit 57d2becb8f

View file

@ -5,6 +5,8 @@ tests.pytests.unit.test_config
Unit tests for salt's config modulet
"""
import sys
import salt.config
@ -21,3 +23,13 @@ def test_call_id_function(tmp_path):
}
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": "c:\\var\\foo" if sys.platform == "win32" else "/var/foo",
}
salt.config.prepend_root_dir(opts, ["foo"])
assert opts["foo"] == str(root / "var" / "foo")