mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-27 14:08:53 +00:00
unit tests: use f-strings (#10993)
This commit is contained in:
parent
e177d1e61a
commit
efad7a0d38
25 changed files with 54 additions and 78 deletions
|
|
@ -31,7 +31,7 @@ def test_pfexec_basic(mocker, parser, reset_cli_args):
|
|||
var_options = {}
|
||||
cmd = call_become_plugin(task, var_options, cmd=default_cmd, executable=default_exe)
|
||||
print(cmd)
|
||||
assert re.match("""%s %s 'echo %s; %s'""" % (pfexec_exe, pfexec_flags, success, default_cmd), cmd) is not None
|
||||
assert re.match(f"""{pfexec_exe} {pfexec_flags} 'echo {success}; {default_cmd}'""", cmd) is not None
|
||||
|
||||
|
||||
def test_pfexec(mocker, parser, reset_cli_args):
|
||||
|
|
@ -53,7 +53,7 @@ def test_pfexec(mocker, parser, reset_cli_args):
|
|||
var_options = {}
|
||||
cmd = call_become_plugin(task, var_options, cmd=default_cmd, executable=default_exe)
|
||||
print(cmd)
|
||||
assert re.match("""%s %s 'echo %s; %s'""" % (pfexec_exe, pfexec_flags, success, default_cmd), cmd) is not None
|
||||
assert re.match(f"""{pfexec_exe} {pfexec_flags} 'echo {success}; {default_cmd}'""", cmd) is not None
|
||||
|
||||
|
||||
def test_pfexec_varoptions(mocker, parser, reset_cli_args):
|
||||
|
|
@ -78,4 +78,4 @@ def test_pfexec_varoptions(mocker, parser, reset_cli_args):
|
|||
}
|
||||
cmd = call_become_plugin(task, var_options, cmd=default_cmd, executable=default_exe)
|
||||
print(cmd)
|
||||
assert re.match("""%s %s 'echo %s; %s'""" % (pfexec_exe, pfexec_flags, success, default_cmd), cmd) is not None
|
||||
assert re.match(f"""{pfexec_exe} {pfexec_flags} 'echo {success}; {default_cmd}'""", cmd) is not None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue