mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Write some tests
This commit is contained in:
parent
8f0f4f1d3b
commit
962f708c92
1 changed files with 23 additions and 0 deletions
|
@ -401,3 +401,26 @@ def test_dict_bool_none_types(option_value, expected):
|
|||
"""
|
||||
result = salt.config._validate_opts({"ssl": option_value})
|
||||
assert result is expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"option_value,expected",
|
||||
[
|
||||
([1, 2, 3], False), # list
|
||||
((1, 2, 3), False), # tuple
|
||||
({"key": "value"}, False), # dict
|
||||
("str", False), # str
|
||||
(True, True), # bool
|
||||
(1, True), # int
|
||||
(0.123, False), # float
|
||||
(None, False), # None
|
||||
],
|
||||
)
|
||||
def test_bool_int_types(option_value, expected):
|
||||
"""
|
||||
Some config settings have three types, dict, bool, and None which should
|
||||
evaluate as True. All others should return False.
|
||||
ssl is a dict, bool type config option
|
||||
"""
|
||||
result = salt.config._validate_opts({"state_queue": option_value})
|
||||
assert result is expected
|
||||
|
|
Loading…
Add table
Reference in a new issue