def tearDown(self): # stop the thread timer try: self.container._v_timer.cancel() time.sleep(1) # allow for thread cleanup except AttributeError: pass # we have an in-memory queue, purge it while True: try: STATUSQUEUE.get(block=False) except Queue.Empty: break
def tearDownContainer(container): from plonesocial.microblog.statuscontainer import STATUSQUEUE # stop the thread timer try: container._v_timer.cancel() time.sleep(1) # allow for thread cleanup except AttributeError: pass # we have an in-memory queue, purge it while True: try: STATUSQUEUE.get(block=False) except Queue.Empty: break
def test_add_queued(self): """Test the queueing""" container = self.container sa = StatusUpdate("test a", "arnold") container.add(sa) values = [x for x in container.values()] # stuff is in queue, not stored self.assertEqual([], values) self.assertFalse(STATUSQUEUE.empty())
def test_add_queued(self): """Test the queueing""" container = self.container sa = StatusUpdate('test a', 'arnold') container.add(sa) values = [x for x in container.values()] # stuff is in queue, not stored self.assertEqual([], values) self.assertFalse(STATUSQUEUE.empty())