Update unit test to pull in product names that are no longer hardcoded

This commit is contained in:
beeankha 2021-03-26 16:00:53 -04:00
parent f38c9e7478
commit b681d1078f
3 changed files with 6 additions and 4 deletions

View File

@ -272,7 +272,9 @@ class TowerAPIModule(TowerModule):
if self._COLLECTION_TYPE not in self.collection_to_version or self.collection_to_version[self._COLLECTION_TYPE] != tower_type:
self.warn("You are using the {0} version of this collection but connecting to {1}".format(self._COLLECTION_TYPE, tower_type))
elif collection_compare_ver != tower_compare_ver:
self.warn("You are running collection version {0} but connecting to {2} version {1}".format(self._COLLECTION_VERSION, tower_version, tower_type))
self.warn(
"You are running collection version {0} but connecting to {2} version {1}".format(self._COLLECTION_VERSION, tower_version, tower_type)
)
self.version_checked = True

View File

@ -59,7 +59,7 @@ def test_version_warning(collection_import, silence_warning):
my_module._COLLECTION_TYPE = "awx"
my_module.get_endpoint('ping')
silence_warning.assert_called_once_with(
'You are running collection version {} but connecting to tower version {}'.format(my_module._COLLECTION_VERSION, ping_version)
'You are running collection version {} but connecting to {} version {}'.format(my_module._COLLECTION_VERSION, awx_name, ping_version)
)
@ -107,7 +107,7 @@ def test_version_warning_strictness_tower(collection_import, silence_warning):
my_module._COLLECTION_TYPE = "tower"
my_module.get_endpoint('ping')
silence_warning.assert_called_once_with(
'You are running collection version {} but connecting to tower version {}'.format(my_module._COLLECTION_VERSION, ping_version)
'You are running collection version {} but connecting to {} version {}'.format(my_module._COLLECTION_VERSION, tower_name, ping_version)
)

View File

@ -40,7 +40,7 @@
job_type: run
module_args: "mkdir -p {{ project_base_dir }}/{{ project_dir_name }}"
module_name: command
wait: True
wait: true
always:
- name: Delete path from setting