def test_run_export_task(self, mock_render, mock_put_file):
        """Tests that the each function is called for each filtered observable."""
        taskmanager.TaskManager.run_task("RandomExport", TaskParams())
        task = ExportTask.find(name="RandomExport")
        assert task is not None
        self.assertEqual(task.status, TaskStatus.completed, task.status_message)
        observable_list, _ = mock_render.call_args[0]
        filename, _ = mock_put_file.call_args[0]
        self.assertTrue(filename.endswith("randomexport"))
        self.assertEqual(len(observable_list), 4)

        self.assertEqual(observable_list[0].value, self.observable1.value)
        self.assertEqual(
            set([t.name for t in observable_list[0].tags]),
            set([t.name for t in self.observable1.tags]),
        )

        self.assertIsNotNone(task.last_run)
Tests that the each function is called for each filtered observable.
tests/core_tests/tasks.py