@@ -0,0 +1,2246 @@
+import mock%0Aimport unittest%0A%0Afrom boss.schedules import (%0A    RunAt,%0A    RunEvery%0A)%0Afrom boss.utils import parse_time, request_maker%0Afrom boss.task import Task%0A%0A%0Aclass TestTask(unittest.TestCase):%0A    def test_local_task(self):%0A        config = object()%0A        task_config = %7B%0A            %22name%22: %22test_task%22,%0A            %22scope%22: %22test_scope%22,%0A            %22schedule%22: %7B%0A                %22type%22: %22run at%22,%0A                %22target_time%22: %2200:00:00%22%0A            %7D,%0A            %22function%22: %7B%0A                %22type%22: %22local%22,%0A                %22target%22: %22boss.utils:parse_time%22%0A            %7D%0A        %7D%0A        task = Task(config, task_config)%0A        assert task.name == task_config%5B%22name%22%5D%0A        assert task.scope == task_config%5B%22scope%22%5D%0A        assert isinstance(task.scheduler, RunAt)%0A        assert task.func is parse_time%0A        with mock.patch.object(task, %22func%22) as mock_func:%0A            params = object()%0A            task.run(params)%0A            mock_func.assert_called_once_with(params)%0A%0A    def test_remote_task(self):%0A        config = object()%0A        task_config = %7B%0A            %22name%22: %22test_task%22,%0A            %22scope%22: %22test_scope%22,%0A            %22schedule%22: %7B%0A                %22type%22: %22run every%22,%0A                %22frequency%22: %2200:05:00%22%0A            %7D,%0A            %22function%22: %7B%0A                %22type%22: %22remote%22,%0A                %22target%22: %22https://postman-echo.com/post%22%0A            %7D%0A        %7D%0A        task = Task(config, task_config)%0A        assert task.name == task_config%5B%22name%22%5D%0A        assert task.scope == task_config%5B%22scope%22%5D%0A        assert isinstance(task.scheduler, RunEvery)%0A        assert isinstance(task.func, request_maker)%0A        with mock.patch.object(task, %22func%22) as mock_func:%0A            params = object()%0A            task.run(params)%0A            mock_func.assert_called_once_with(params)%0A%0A    def test_unknown_task(self):%0A        config = object()%0A        task_config = %7B%0A            %22name%22: %22test_task%22,%0A            %22scope%22: %22test_scope%22,%0A            %22schedule%22: %7B%0A                %22type%22: %22run every%22,%0A                %22frequency%22: %2200:05:00%22%0A            %7D,%0A            %22function%22: %7B%0A                %22type%22: %22unknown task%22,%0A            %7D%0A        %7D%0A        self.assertRaises(ValueError, Task, config, task_config)%0A

Add tests for Task