Ejemplo n.º 1
0
    def test_task_decorator_adds_callable_to_registry(self):
        TIEMPO_REGISTRY.clear()

        task = Task(priority=1, periodic=True, force_interval=1)
        decorated = task(some_callable)  # Pushes onto registry dict

        self.assertEqual(len(TIEMPO_REGISTRY), 1)  # Our task it the only one in the dict.

        key = TIEMPO_REGISTRY.keys()[0]  # Grab the key...

        self.assertEqual(key.split(".")[-1], "some_callable")  # And sure enough, it matches our callable.
Ejemplo n.º 2
0
    def test_task_decorator_adds_callable_to_registry(self):
        TIEMPO_REGISTRY.clear()

        task = Task(priority=1, periodic=True, force_interval=1)
        decorated = task(some_callable)  # Pushes onto registry dict

        self.assertEqual(len(TIEMPO_REGISTRY),
                         1)  # Our task it the only one in the dict.

        key = TIEMPO_REGISTRY.keys()[0]  # Grab the key...

        self.assertEqual(
            key.split('.')[-1],
            'some_callable')  # And sure enough, it matches our callable.