def test_consumer_override_api_host(self): consumer = mixpanel.Consumer(api_host="api-eu.mixpanel.com") with self._assertSends('https://api-eu.mixpanel.com/track', { "ip": 0, "verbose": 1, "data": '{"foo":"bar"}' }, consumer=consumer): consumer.send('events', '{"foo":"bar"}') with self._assertSends('https://api-eu.mixpanel.com/engage', { "ip": 0, "verbose": 1, "data": '{"foo":"bar"}' }, consumer=consumer): consumer.send('people', '{"foo":"bar"}')
def setUp(self): self.consumer = mixpanel.Consumer()
def setup_class(cls): cls.consumer = mixpanel.Consumer(request_timeout=30)
def __init__(self): super().__init__(daemon=True) self.consumer = mixpanel.Consumer()
def test_consumer_override_api_host(self): consumer = mixpanel.Consumer(api_host="api-eu.mixpanel.com") with self._assertSends('https://api-eu.mixpanel.com/track', 'ip=0&data=IkV2ZW50Ig%3D%3D&verbose=1', consumer=consumer): consumer.send('events', '"Event"') with self._assertSends('https://api-eu.mixpanel.com/engage', 'ip=0&data=IlBlb3BsZSI%3D&verbose=1', consumer=consumer): consumer.send('people', '"People"')
def setUp(self): self.consumer = mixpanel.Consumer(request_timeout=30)
def __init__(self): self.consumer = mixpanel.Consumer()