def setUp(self): self.client = CeleryClient( servers=['http://example.com'], organization_id='org', app_id='app', secret_token='secret', )
class CeleryIntegratedClientTest(TestCase): def setUp(self): self.client = CeleryClient( servers=['http://example.com'], organization_id='org', app_id='app', secret_token='secret', ) @mock.patch('opbeat.contrib.django.celery.CeleryClient.send_raw_integrated') def test_send_encoded(self, send_raw): self.client.send_integrated('foo') send_raw.delay.assert_called_once_with('foo') @skipIf(not has_with_eager_tasks, 'with_eager_tasks is not available') @with_eager_tasks @mock.patch('opbeat.contrib.django.DjangoClient.send_encoded') def test_with_eager(self, send_encoded): """ Integration test to ensure it propagates all the way down and calls the parent client's send_encoded method. """ self.client.capture('Message', message='test') self.assertEquals(send_encoded.call_count, 1)
class CeleryIntegratedClientTest(TestCase): def setUp(self): self.client = CeleryClient( servers=['http://example.com'], organization_id='org', app_id='app', secret_token='secret', ) @mock.patch('opbeat.contrib.django.celery.CeleryClient.send_raw_integrated') def test_send_encoded(self, send_raw): self.client.send_integrated('foo') send_raw.delay.assert_called_once_with('foo') @with_eager_tasks @mock.patch('opbeat.contrib.django.DjangoClient.send_encoded') def test_with_eager(self, send_encoded): """ Integration test to ensure it propagates all the way down and calls the parent client's send_encoded method. """ self.client.capture('Message', message='test') self.assertEquals(send_encoded.call_count, 1)
class CeleryIntegratedClientTest(TestCase): def setUp(self): self.client = CeleryClient( servers=['http://example.com'], organization_id='org', app_id='app', secret_token='secret', ) @pytest.mark.skipif(not has_with_eager_tasks, reason='with_eager_tasks is not available') @with_eager_tasks @mock.patch('opbeat.contrib.django.DjangoClient.send_encoded') def test_with_eager(self, send_encoded): """ Integration test to ensure it propagates all the way down and calls the parent client's send_encoded method. """ self.client.capture('Message', message='test') self.assertEquals(send_encoded.call_count, 1)