Skip to content

Commit d81f651

Browse files
Update tests for the multiple number of threads
1 parent 16e2661 commit d81f651

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

analytics/test/client.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,14 @@ def test_shutdown(self):
256256
# 1. client queue is empty
257257
# 2. consumer thread has stopped
258258
self.assertTrue(client.queue.empty())
259-
self.assertFalse(client.consumer.is_alive())
259+
for consumer in client.consumers:
260+
self.assertFalse(consumer.is_alive())
260261

261262
def test_synchronous(self):
262263
client = Client('testsecret', sync_mode=True)
263264

264265
success, message = client.identify('userId')
265-
self.assertIsNone(client.consumer)
266+
self.assertFalse(client.consumers)
266267
self.assertTrue(client.queue.empty())
267268
self.assertTrue(success)
268269

@@ -333,8 +334,10 @@ def mock_post_fn(*args, **kwargs):
333334

334335
def test_user_defined_timeout(self):
335336
client = Client('testsecret', timeout=10)
336-
self.assertEquals(client.consumer.timeout, 10)
337+
for consumer in client.consumers:
338+
self.assertEquals(consumer.timeout, 10)
337339

338340
def test_default_timeout_15(self):
339341
client = Client('testsecret')
340-
self.assertEquals(client.consumer.timeout, 15)
342+
for consumer in client.consumers:
343+
self.assertEquals(consumer.timeout, 15)

0 commit comments

Comments
 (0)