mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add test for pillar.keys to increase code-coverage
This commit is contained in:
parent
7fbc2d1e02
commit
701c819fd9
1 changed files with 17 additions and 0 deletions
|
@ -163,3 +163,20 @@ def test_pillar_get_int_key():
|
|||
res = pillarmod.get(key=12345, default=default, merge=True)
|
||||
assert {"l2": {"l3": "my_luggage_code"}} == res
|
||||
assert {"l2": {"l3": "your_luggage_code"}} == default
|
||||
|
||||
|
||||
def test_pillar_keys():
|
||||
"""
|
||||
Confirm that we can access pillar keys
|
||||
"""
|
||||
with patch.dict(pillarmod.__pillar__, {"pkg": {"apache": "httpd"}}):
|
||||
test_key = "pkg"
|
||||
assert pillarmod.keys(test_key) == ["apache"]
|
||||
|
||||
with patch.dict(
|
||||
pillarmod.__pillar__,
|
||||
{"12345": {"xyz": "my_luggage_code"}, "7": {"11": {"12": "13"}}},
|
||||
):
|
||||
test_key = "7:11"
|
||||
res = pillarmod.keys(test_key)
|
||||
assert res == ["12"]
|
||||
|
|
Loading…
Add table
Reference in a new issue