Exemplo n.º 1
0
    def test_task_decorators(self):
        huey = RedisHuey()

        def test_fn():
            pass

        test_fn_task = huey.task()(test_fn)
        test_fn_cron = huey.periodic_task(crontab(minute='0'))(test_fn)

        self.assertTrue(isinstance(test_fn_task, TaskWrapper))
        self.assertTrue(test_fn_task.func is test_fn)
        self.assertTrue(isinstance(test_fn_cron, TaskWrapper))
        self.assertTrue(test_fn_cron.func is test_fn)

        test_cron_task = huey.periodic_task(crontab(minute='0'))(test_fn_task)
        self.assertTrue(isinstance(test_cron_task, TaskWrapper))
        self.assertTrue(test_cron_task.func is test_fn)
Exemplo n.º 2
0
    def test_task_decorators(self):
        huey = RedisHuey()

        def test_fn():
            pass

        test_fn_task = huey.task()(test_fn)
        test_fn_cron = huey.periodic_task(crontab(minute='0'))(test_fn)

        self.assertTrue(isinstance(test_fn_task, TaskWrapper))
        self.assertTrue(test_fn_task.func is test_fn)
        self.assertTrue(isinstance(test_fn_cron, TaskWrapper))
        self.assertTrue(test_fn_cron.func is test_fn)

        test_cron_task = huey.periodic_task(crontab(minute='0'))(test_fn_task)
        self.assertTrue(isinstance(test_cron_task, TaskWrapper))
        self.assertTrue(test_cron_task.func is test_fn)