def test_returns_all_jobs_if_delta_is_high(self): """ ``find_pending_jobs_to_cancel`` returns all jobs if ``delta`` is greater than the length of the jobs """ self.assertEqual( sorted(supervisor.find_pending_jobs_to_cancel(mock.ANY, self.cancellable_state, 100)), ["1", "2", "3", "4", "5"], )
def test_returns_most_recent_jobs(self): """ ``find_pending_jobs_to_cancel`` returns the top ``delta`` recent jobs. """ self.assertEqual( supervisor.find_pending_jobs_to_cancel(mock.ANY, self.cancellable_state, 3), ['5', '2', '3'])