From 497036f16b2ba2238514502fc3e93e1eb8797001 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 7 Oct 2023 08:47:03 +0100 Subject: [PATCH] Run `pygupgrade` against the files changed in the merge-forward Signed-off-by: Pedro Algarvio --- tests/pytests/unit/utils/test_cloud.py | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/pytests/unit/utils/test_cloud.py b/tests/pytests/unit/utils/test_cloud.py index ea55af44ef5..2d18d944b33 100644 --- a/tests/pytests/unit/utils/test_cloud.py +++ b/tests/pytests/unit/utils/test_cloud.py @@ -461,8 +461,8 @@ def test_ssh_gateway_arguments_default_alive_args(): server_alive_interval = 60 server_alive_count_max = 3 arguments = ssh_gateway_arguments({"ssh_gateway": "host"}) - assert "-oServerAliveInterval={}".format(server_alive_interval) in arguments - assert "-oServerAliveCountMax={}".format(server_alive_count_max) in arguments + assert f"-oServerAliveInterval={server_alive_interval}" in arguments + assert f"-oServerAliveCountMax={server_alive_count_max}" in arguments def test_ssh_gateway_arguments_alive_args(): @@ -475,8 +475,8 @@ def test_ssh_gateway_arguments_alive_args(): "server_alive_count_max": server_alive_count_max, } ) - assert "-oServerAliveInterval={}".format(server_alive_interval) in arguments - assert "-oServerAliveCountMax={}".format(server_alive_count_max) in arguments + assert f"-oServerAliveInterval={server_alive_interval}" in arguments + assert f"-oServerAliveCountMax={server_alive_count_max}" in arguments def test_wait_for_port_default_alive_args(): @@ -491,8 +491,8 @@ def test_wait_for_port_default_alive_args(): ) assert exec_ssh_cmd.call_count == 2 ssh_call = exec_ssh_cmd.call_args[0][0] - assert "-oServerAliveInterval={}".format(server_alive_interval) in ssh_call - assert "-oServerAliveCountMax={}".format(server_alive_count_max) in ssh_call + assert f"-oServerAliveInterval={server_alive_interval}" in ssh_call + assert f"-oServerAliveCountMax={server_alive_count_max}" in ssh_call def test_wait_for_port_alive_args(): @@ -509,8 +509,8 @@ def test_wait_for_port_alive_args(): ) assert exec_ssh_cmd.call_count == 2 ssh_call = exec_ssh_cmd.call_args[0][0] - assert "-oServerAliveInterval={}".format(server_alive_interval) in ssh_call - assert "-oServerAliveCountMax={}".format(server_alive_count_max) in ssh_call + assert f"-oServerAliveInterval={server_alive_interval}" in ssh_call + assert f"-oServerAliveCountMax={server_alive_count_max}" in ssh_call def test_scp_file_default_alive_args(): @@ -527,8 +527,8 @@ def test_scp_file_default_alive_args(): ) assert exec_ssh_cmd.call_count == 1 ssh_call = exec_ssh_cmd.call_args[0][0] - assert "-oServerAliveInterval={}".format(server_alive_interval) in ssh_call - assert "-oServerAliveCountMax={}".format(server_alive_count_max) in ssh_call + assert f"-oServerAliveInterval={server_alive_interval}" in ssh_call + assert f"-oServerAliveCountMax={server_alive_count_max}" in ssh_call def test_scp_file_alive_args(): @@ -550,8 +550,8 @@ def test_scp_file_alive_args(): ) assert exec_ssh_cmd.call_count == 1 ssh_call = exec_ssh_cmd.call_args[0][0] - assert "-oServerAliveInterval={}".format(server_alive_interval) in ssh_call - assert "-oServerAliveCountMax={}".format(server_alive_count_max) in ssh_call + assert f"-oServerAliveInterval={server_alive_interval}" in ssh_call + assert f"-oServerAliveCountMax={server_alive_count_max}" in ssh_call def test_sftp_file_default_alive_args(): @@ -568,8 +568,8 @@ def test_sftp_file_default_alive_args(): ) assert exec_ssh_cmd.call_count == 1 ssh_call = exec_ssh_cmd.call_args[0][0] - assert "-oServerAliveInterval={}".format(server_alive_interval) in ssh_call - assert "-oServerAliveCountMax={}".format(server_alive_count_max) in ssh_call + assert f"-oServerAliveInterval={server_alive_interval}" in ssh_call + assert f"-oServerAliveCountMax={server_alive_count_max}" in ssh_call def test_sftp_file_alive_args(): @@ -591,8 +591,8 @@ def test_sftp_file_alive_args(): ) assert exec_ssh_cmd.call_count == 1 ssh_call = exec_ssh_cmd.call_args[0][0] - assert "-oServerAliveInterval={}".format(server_alive_interval) in ssh_call - assert "-oServerAliveCountMax={}".format(server_alive_count_max) in ssh_call + assert f"-oServerAliveInterval={server_alive_interval}" in ssh_call + assert f"-oServerAliveCountMax={server_alive_count_max}" in ssh_call def test_deploy_script_ssh_timeout(): @@ -656,7 +656,7 @@ def test_deploy_windows_master(master, expected): ) as mock: cloud.deploy_windows(host="test", win_installer="install.exe", master=master) expected_cmd = "c:\\salttemp\\install.exe" - expected_args = "/S /master={} /minion-name=None".format(expected) + expected_args = f"/S /master={expected} /minion-name=None" assert mock.call_args_list[0].args[0] == expected_cmd assert mock.call_args_list[0].args[1] == expected_args