예제 #1
0
파일: test_tasks.py 프로젝트: doziya/AWX
 def test_no_unwanted_dependent_inventory_updates(self, project, scm_revision_file):
     task = RunProjectUpdate()
     task.revision_path = scm_revision_file
     proj_update = ProjectUpdate.objects.create(project=project)
     with mock.patch.object(RunProjectUpdate, '_update_dependent_inventories') as inv_update_mck:
         task.post_run_hook(proj_update, 'successful')
         assert not inv_update_mck.called
예제 #2
0
파일: test_tasks.py 프로젝트: doziya/AWX
 def test_dependent_inventory_updates_is_called(self, scm_inventory_source, scm_revision_file):
     task = RunProjectUpdate()
     task.revision_path = scm_revision_file
     proj_update = ProjectUpdate.objects.create(project=scm_inventory_source.source_project)
     with mock.patch.object(RunProjectUpdate, '_update_dependent_inventories') as inv_update_mck:
         task.post_run_hook(proj_update, 'successful')
         inv_update_mck.assert_called_once_with(proj_update, mock.ANY)