mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add test when config is missing main
This commit is contained in:
parent
07bb453204
commit
8e9368263f
1 changed files with 9 additions and 0 deletions
|
@ -2494,6 +2494,15 @@ def test_get_yum_config_unreadable():
|
|||
yumpkg._get_yum_config()
|
||||
|
||||
|
||||
def test_get_yum_config_no_main(caplog):
|
||||
mock_false = MagicMock(return_value=False)
|
||||
with patch.object(configparser.ConfigParser, "read"), patch.object(
|
||||
configparser.ConfigParser, "has_section", mock_false
|
||||
), patch("os.path.exists", MagicMock(return_value=True)):
|
||||
yumpkg._get_yum_config()
|
||||
assert "Could not find [main] section" in caplog.text
|
||||
|
||||
|
||||
def test_normalize_basedir_str():
|
||||
basedir = "/etc/yum/yum.conf,/etc/yum.conf"
|
||||
result = yumpkg._normalize_basedir(basedir)
|
||||
|
|
Loading…
Add table
Reference in a new issue