Beispiel #1
0
    def test_unpatch_app(self):
        """
        When unpatch_app is called on a patched app
            we unpatch the `task()` method
        """
        # Assert it is patched before we start
        self.assertIsInstance(celery.Celery.task, wrapt.BoundFunctionWrapper)

        # Unpatch the app
        unpatch_app(celery.Celery)

        # Assert the method is not patched
        self.assertFalse(isinstance(celery.Celery.task, wrapt.BoundFunctionWrapper))
        self.assertFalse(isinstance(celery.Celery.Task.__init__, wrapt.BoundFunctionWrapper))
Beispiel #2
0
    def test_unpatch_app(self):
        """
        When unpatch_app is called on a patched app
            we unpatch the `task()` method
        """
        # Assert it is patched before we start
        self.assertIsInstance(celery.Celery.task, wrapt.BoundFunctionWrapper)

        # Unpatch the app
        unpatch_app(celery.Celery)

        # Assert the method is not patched
        self.assertFalse(
            isinstance(celery.Celery.task, wrapt.BoundFunctionWrapper))
        self.assertFalse(
            isinstance(celery.Celery.Task.__init__,
                       wrapt.BoundFunctionWrapper))
Beispiel #3
0
 def tearDown(self):
     unpatch_app(celery.Celery)
Beispiel #4
0
 def tearDown(self):
     unpatch_app(celery.Celery)
     unpatch_task(celery.Task)
Beispiel #5
0
 def tearDown(self):
     unpatch_app(celery.Celery)