Пример #1
0
 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"}')
Пример #2
0
 def setUp(self):
     self.consumer = mixpanel.Consumer()
Пример #3
0
 def setup_class(cls):
     cls.consumer = mixpanel.Consumer(request_timeout=30)
Пример #4
0
 def __init__(self):
     super().__init__(daemon=True)
     self.consumer = mixpanel.Consumer()
Пример #5
0
 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"')
Пример #6
0
 def setUp(self):
     self.consumer = mixpanel.Consumer(request_timeout=30)
Пример #7
0
 def __init__(self):
     self.consumer = mixpanel.Consumer()