unit tests (modules): use f-strings (#10992)

* unit tests (modules): use f-strings

* Apply suggestions from code review
This commit is contained in:
Alexei Znamensky
2025-10-27 11:08:33 +13:00
committed by GitHub
parent f6781f654e
commit e177d1e61a
33 changed files with 140 additions and 159 deletions

View File

@@ -17,9 +17,9 @@ class NPMModuleTestCase(ModuleTestCase):
def setUp(self):
super(NPMModuleTestCase, self).setUp()
ansible_module_path = "ansible_collections.community.general.plugins.modules.npm.AnsibleModule"
self.mock_run_command = patch('%s.run_command' % ansible_module_path)
self.mock_run_command = patch(f'{ansible_module_path}.run_command')
self.module_main_command = self.mock_run_command.start()
self.mock_get_bin_path = patch('%s.get_bin_path' % ansible_module_path)
self.mock_get_bin_path = patch(f'{ansible_module_path}.get_bin_path')
self.get_bin_path = self.mock_get_bin_path.start()
self.get_bin_path.return_value = '/testbin/npm'