Esempio n. 1
0
def tearDownContainer(container):
    from ploneintranet.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
Esempio n. 2
0
def tearDownContainer(container):
    from ploneintranet.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
Esempio n. 3
0
 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())