1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-04 19:26:58 +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:
Alexei Znamensky 2025-10-27 11:08:33 +13:00 committed by GitHub
parent f6781f654e
commit e177d1e61a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 140 additions and 159 deletions

View file

@ -29,7 +29,7 @@ PARAMS_WITH_CHANGES = dict(
config='config.json',
state='present',
data=dict(name=NETWORK_SET['name'],
newName=NETWORK_SET['name'] + " - Renamed",
newName=f"{NETWORK_SET['name']} - Renamed",
networkUris=['/rest/ethernet-networks/aaa-bbb-ccc', 'Name of a Network'])
)
@ -80,7 +80,7 @@ class NetworkSetModuleSpec(unittest.TestCase,
)
def test_update_when_data_has_modified_attributes(self):
data_merged = dict(name=NETWORK_SET['name'] + " - Renamed",
data_merged = dict(name=f"{NETWORK_SET['name']} - Renamed",
networkUris=['/rest/ethernet-networks/aaa-bbb-ccc',
'/rest/ethernet-networks/ddd-eee-fff']
)
@ -109,7 +109,7 @@ class NetworkSetModuleSpec(unittest.TestCase,
self.mock_ansible_module.fail_json.assert_called_once_with(
exception=mock.ANY,
msg=NetworkSetModule.MSG_ETHERNET_NETWORK_NOT_FOUND + "Name of a Network"
msg=f"{NetworkSetModule.MSG_ETHERNET_NETWORK_NOT_FOUND}Name of a Network"
)
def test_should_remove_network(self):