Example #1
0
class CeleryIntegratedClientTest(TestCase):
    def setUp(self):
        self.client = CeleryClient()

    @mock.patch('raven_django.celery.send_raw_integrated')
    def test_send_encoded(self, send_raw):
        with Settings(INSTALLED_APPS=tuple(settings.INSTALLED_APPS) + ('sentry',)):
            self.client.send_integrated('foo')

            send_raw.delay.assert_called_once_with('foo')

    @mock.patch('raven_django.celery.send_raw_integrated')
    def test_without_eager(self, send_raw):
        """
        Integration test to ensure it propagates all the way down
        and calls delay on the task.
        """
        with Settings(INSTALLED_APPS=tuple(settings.INSTALLED_APPS) + ('sentry',)):
            self.client.captureMessage(message='test')

            self.assertEquals(send_raw.delay.call_count, 1)
Example #2
0
class CeleryIntegratedClientTest(TestCase):
    def setUp(self):
        self.client = CeleryClient()

    @mock.patch('raven_django.celery.send_raw_integrated')
    def test_send_encoded(self, send_raw):
        with Settings(INSTALLED_APPS=tuple(settings.INSTALLED_APPS) +
                      ('sentry', )):
            self.client.send_integrated('foo')

            send_raw.delay.assert_called_once_with('foo')

    @mock.patch('raven_django.celery.send_raw_integrated')
    def test_without_eager(self, send_raw):
        """
        Integration test to ensure it propagates all the way down
        and calls delay on the task.
        """
        with Settings(INSTALLED_APPS=tuple(settings.INSTALLED_APPS) +
                      ('sentry', )):
            self.client.captureMessage(message='test')

            self.assertEquals(send_raw.delay.call_count, 1)
Example #3
0
class CeleryIsolatedClientTest(TestCase):
    def setUp(self):
        self.client = CeleryClient(
            servers=['http://example.com'],
            public_key='public',
            secret_key='secret',
        )

    @mock.patch('raven_django.celery.send_raw')
    def test_send_encoded(self, send_raw):
        self.client.send_encoded('foo')

        send_raw.delay.assert_called_once_with('foo')

    @mock.patch('raven_django.celery.send_raw')
    def test_without_eager(self, send_raw):
        """
        Integration test to ensure it propagates all the way down
        and calls delay on the task.
        """
        self.client.captureMessage(message='test')

        self.assertEquals(send_raw.delay.call_count, 1)
Example #4
0
class CeleryIsolatedClientTest(TestCase):
    def setUp(self):
        self.client = CeleryClient(
            servers=['http://example.com'],
            public_key='public',
            secret_key='secret',
        )

    @mock.patch('raven_django.celery.send_raw')
    def test_send_encoded(self, send_raw):
        self.client.send_encoded('foo')

        send_raw.delay.assert_called_once_with('foo')

    @mock.patch('raven_django.celery.send_raw')
    def test_without_eager(self, send_raw):
        """
        Integration test to ensure it propagates all the way down
        and calls delay on the task.
        """
        self.client.captureMessage(message='test')

        self.assertEquals(send_raw.delay.call_count, 1)
Example #5
0
 def setUp(self):
     self.client = CeleryClient()
Example #6
0
 def setUp(self):
     self.client = CeleryClient(
         servers=['http://example.com'],
         public_key='public',
         secret_key='secret',
     )
Example #7
0
 def setUp(self):
     self.client = CeleryClient()
Example #8
0
 def setUp(self):
     self.client = CeleryClient(
         servers=['http://example.com'],
         public_key='public',
         secret_key='secret',
     )