mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add basic unit test for prepend_root_dir method
This commit is contained in:
parent
dfd6221cc5
commit
57d2becb8f
1 changed files with 12 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue