mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-06 12:07:14 +00:00
unit tests (modules): use f-strings (#10992)
* unit tests (modules): use f-strings * Apply suggestions from code review
This commit is contained in:
parent
f6781f654e
commit
e177d1e61a
33 changed files with 140 additions and 159 deletions
|
|
@ -22,7 +22,7 @@ class TestApkQueryLatest(unittest.TestCase):
|
|||
def test_not_latest(self, mock_module):
|
||||
apk.APK_PATH = [""]
|
||||
for module_name in self.module_names:
|
||||
command_output = module_name + '-2.0.0-r1 < 3.0.0-r2 '
|
||||
command_output = f"{module_name}-2.0.0-r1 < 3.0.0-r2 "
|
||||
mock_module.run_command.return_value = (0, command_output, None)
|
||||
command_result = apk.query_latest(mock_module, module_name)
|
||||
self.assertFalse(command_result)
|
||||
|
|
@ -31,7 +31,7 @@ class TestApkQueryLatest(unittest.TestCase):
|
|||
def test_latest(self, mock_module):
|
||||
apk.APK_PATH = [""]
|
||||
for module_name in self.module_names:
|
||||
command_output = module_name + '-2.0.0-r1 = 2.0.0-r1 '
|
||||
command_output = f"{module_name}-2.0.0-r1 = 2.0.0-r1 "
|
||||
mock_module.run_command.return_value = (0, command_output, None)
|
||||
command_result = apk.query_latest(mock_module, module_name)
|
||||
self.assertTrue(command_result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue