def test_schedule_batches_schedules_batches(self): ret = schedule_batches(*self.test_args) expected_result = [ 'echo "echo 1 2 | mail -s \'at command output\' [email protected]" 2>&1 | at 5', 'echo "echo 3 4 | mail -s \'at command output\' [email protected]" 2>&1 | at 6', 'echo "echo 5 6 | mail -s \'at command output\' [email protected]" 2>&1 | at 7', 'echo "echo 7 8 | mail -s \'at command output\' [email protected]" 2>&1 | at 8', 'echo "echo 9 10 | mail -s \'at command output\' [email protected]" 2>&1 | at 9' ] self.assertEqual(map(lambda x: x, ret), expected_result)
def test_schedule_batches_calls_atmap_for_each_batch(self, atmap): schedule_batches(*self.test_args) self.assertEqual(len(self.batches), len(atmap.mock_calls))