mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Run pygupgrade
against changed files from merge-forward
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
a90653f337
commit
cb44e8887b
1 changed files with 9 additions and 11 deletions
|
@ -450,7 +450,7 @@ def test_gnu_slash_linux_in_os_name():
|
|||
), patch.object(
|
||||
os.path, "exists", path_exists_mock
|
||||
), patch(
|
||||
"{}.__import__".format(built_in), side_effect=_import_mock
|
||||
f"{built_in}.__import__", side_effect=_import_mock
|
||||
), patch.object(
|
||||
os.path, "isfile", path_isfile_mock
|
||||
), patch.object(
|
||||
|
@ -528,7 +528,7 @@ def test_suse_os_from_cpe_data():
|
|||
), patch.object(
|
||||
os.path, "exists", path_exists_mock
|
||||
), patch(
|
||||
"{}.__import__".format(built_in), side_effect=_import_mock
|
||||
f"{built_in}.__import__", side_effect=_import_mock
|
||||
), patch.object(
|
||||
os.path, "isfile", MagicMock(return_value=False)
|
||||
), patch.object(
|
||||
|
@ -603,7 +603,7 @@ def _run_os_grains_tests(os_release_data, os_release_map, expectation):
|
|||
), patch.object(
|
||||
os.path, "exists", path_isfile_mock
|
||||
), patch(
|
||||
"{}.__import__".format(built_in), side_effect=_import_mock
|
||||
f"{built_in}.__import__", side_effect=_import_mock
|
||||
), patch.object(
|
||||
os.path, "isfile", path_isfile_mock
|
||||
), patch.object(
|
||||
|
@ -1709,7 +1709,7 @@ def test_docker_virtual(cgroup_substr):
|
|||
"""
|
||||
Test if virtual grains are parsed correctly in Docker.
|
||||
"""
|
||||
cgroup_data = "10:memory{}a_long_sha256sum".format(cgroup_substr)
|
||||
cgroup_data = f"10:memory{cgroup_substr}a_long_sha256sum"
|
||||
log.debug("Testing Docker cgroup substring '%s'", cgroup_substr)
|
||||
with patch.object(os.path, "isdir", MagicMock(return_value=False)), patch.object(
|
||||
os.path,
|
||||
|
@ -1844,7 +1844,7 @@ def test_illumos_virtual():
|
|||
if cmd == "/usr/bin/zonename":
|
||||
# NOTE: we return the name of the zone
|
||||
return "myzone"
|
||||
mylogdebug = "cmd.run_all: '{}'".format(cmd)
|
||||
mylogdebug = f"cmd.run_all: '{cmd}'"
|
||||
log.debug(mylogdebug)
|
||||
|
||||
def _cmd_all_side_effect(cmd):
|
||||
|
@ -1948,7 +1948,7 @@ def _check_ipaddress(value, ip_v):
|
|||
"""
|
||||
for val in value:
|
||||
assert isinstance(val, str)
|
||||
ip_method = "is_ipv{}".format(ip_v)
|
||||
ip_method = f"is_ipv{ip_v}"
|
||||
assert getattr(salt.utils.network, ip_method)(val)
|
||||
|
||||
|
||||
|
@ -1958,11 +1958,9 @@ def _check_empty(key, value, empty):
|
|||
if empty is True and value exists assert error
|
||||
"""
|
||||
if not empty and not value:
|
||||
raise Exception("{} is empty, expecting a value".format(key))
|
||||
raise Exception(f"{key} is empty, expecting a value")
|
||||
elif empty and value:
|
||||
raise Exception(
|
||||
"{} is suppose to be empty. value: {} exists".format(key, value)
|
||||
)
|
||||
raise Exception(f"{key} is suppose to be empty. value: {value} exists")
|
||||
|
||||
|
||||
def _check_ip_fqdn_set(value, empty, _set=None):
|
||||
|
@ -2335,7 +2333,7 @@ def test_core_virtual():
|
|||
"pid": 78,
|
||||
"retcode": 0,
|
||||
"stderr": "",
|
||||
"stdout": "\n\n{}".format(virt),
|
||||
"stdout": f"\n\n{virt}",
|
||||
}
|
||||
)
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue