From 043a7f8599dd79f4b7ef10e613deeef91b9fb55f Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Thu, 27 Aug 2020 16:38:00 -0400 Subject: [PATCH] more get_ansible_version removal --- .../functional/test_inventory_source_injectors.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/awx/main/tests/functional/test_inventory_source_injectors.py b/awx/main/tests/functional/test_inventory_source_injectors.py index 994c2b4c11..4601668d25 100644 --- a/awx/main/tests/functional/test_inventory_source_injectors.py +++ b/awx/main/tests/functional/test_inventory_source_injectors.py @@ -209,7 +209,7 @@ def test_inventory_update_injected_content(this_kind, inventory, fake_credential env, content = read_content(private_data_dir, envvars, inventory_update) # Assert inventory plugin inventory file is in private_data_dir - inventory_filename = InventorySource.injectors[inventory_update.source]('2.9').filename + inventory_filename = InventorySource.injectors[inventory_update.source]().filename assert len([True for k in content.keys() if k.endswith(inventory_filename)]) > 0, \ f"'{inventory_filename}' file not found in inventory update runtime files {content.keys()}" @@ -252,8 +252,7 @@ def test_inventory_update_injected_content(this_kind, inventory, fake_credential with mock.patch('awx.main.queue.CallbackQueueDispatcher.dispatch', lambda self, obj: None): # Also do not send websocket status updates with mock.patch.object(UnifiedJob, 'websocket_emit_status', mock.Mock()): - with mock.patch.object(task, 'get_ansible_version', return_value='2.13'): - # The point of this test is that we replace run with assertions - with mock.patch('awx.main.tasks.ansible_runner.interface.run', substitute_run): - # so this sets up everything for a run and then yields control over to substitute_run - task.run(inventory_update.pk) + # The point of this test is that we replace run with assertions + with mock.patch('awx.main.tasks.ansible_runner.interface.run', substitute_run): + # so this sets up everything for a run and then yields control over to substitute_run + task.run(inventory_update.pk)