コード例 #1
0
ファイル: test_control.py プロジェクト: Scalr/celery
 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
ファイル: test_control.py プロジェクト: xacce/celery
 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)