示例#1
0
 def test_shutdown(self):
     with patch('celery.worker.pidbox.ignore_errors') as eig:
         parent = Mock()
         pbox = Pidbox(parent)
         pbox._close_channel = Mock()
         assert pbox.c is parent
         pconsumer = pbox.consumer = Mock()
         cancel = pconsumer.cancel
         pbox.shutdown(parent)
         eig.assert_called_with(parent, cancel)
         pbox._close_channel.assert_called_with(parent)
示例#2
0
 def test_shutdown(self):
     with patch('celery.worker.pidbox.ignore_errors') as eig:
         parent = Mock()
         pbox = Pidbox(parent)
         pbox._close_channel = Mock()
         self.assertIs(pbox.c, parent)
         pconsumer = pbox.consumer = Mock()
         cancel = pconsumer.cancel
         pbox.shutdown(parent)
         eig.assert_called_with(parent, cancel)
         pbox._close_channel.assert_called_with(parent)