コード例 #1
0
 def test_create_threaded(self):
     w = Mock()
     w.use_eventloop = False
     x = WorkerComponent(w)
     x.instantiate = Mock()
     r = x.create(w)
     x.instantiate.assert_called_with(w.autoreloader_cls, w)
     self.assertIs(r, w.autoreloader)
コード例 #2
0
ファイル: test_autoreload.py プロジェクト: 1995rishi/flaskmap
 def test_create_threaded(self):
     w = Mock()
     w.use_eventloop = False
     x = WorkerComponent(w)
     x.instantiate = Mock()
     r = x.create(w)
     x.instantiate.assert_called_with(w.autoreloader_cls, w)
     self.assertIs(r, w.autoreloader)
コード例 #3
0
ファイル: test_autoreload.py プロジェクト: ahalife/celery
 def test_create(self):
     w = Mock()
     x = WorkerComponent(w)
     x.instantiate = Mock()
     r = x.create(w)
     x.instantiate.assert_called_with(w.autoreloader_cls,
                                      controller=w)
     self.assertIs(r, w.autoreloader)
コード例 #4
0
 def test_create_ev(self, kqueue, kevent):
     w = Mock()
     w.use_eventloop = True
     x = WorkerComponent(w)
     x.instantiate = Mock()
     r = x.create(w)
     x.instantiate.assert_called_with(w.autoreloader_cls, w)
     self.assertIsNone(r)
     w.hub.on_init.append.assert_called_with(w.autoreloader.on_poll_init)
     w.hub.on_close.append.assert_called_with(w.autoreloader.on_poll_close)
コード例 #5
0
ファイル: test_autoreload.py プロジェクト: charettes/celery
 def test_create_ev(self, kqueue, kevent):
     w = Mock()
     w.use_eventloop = True
     x = WorkerComponent(w)
     x.instantiate = Mock()
     r = x.create(w)
     x.instantiate.assert_called_with(w.autoreloader_cls, w)
     self.assertIsNone(r)
     w.hub.on_init.append.assert_called_with(w.autoreloader.on_poll_init)
     w.hub.on_close.append.assert_called_with(w.autoreloader.on_poll_close)
コード例 #6
0
ファイル: test_autoreload.py プロジェクト: 1995rishi/flaskmap
 def test_create_ev(self, kq, kqueue, kevent):
     w = Mock()
     w.use_eventloop = True
     x = WorkerComponent(w)
     x.instantiate = Mock()
     r = x.create(w)
     x.instantiate.assert_called_with(w.autoreloader_cls, w)
     x.register_with_event_loop(w, w.hub)
     self.assertIsNone(r)
     w.hub.on_close.add.assert_called_with(
         w.autoreloader.on_event_loop_close,
     )
コード例 #7
0
 def test_create_ev(self, kqueue, kevent):
     w = Mock()
     w.use_eventloop = True
     x = WorkerComponent(w)
     x.instantiate = Mock()
     r = x.create(w)
     x.instantiate.assert_called_with(w.autoreloader_cls, w)
     x.register_with_event_loop(w, w.hub)
     self.assertIsNone(r)
     w.hub.on_close.add.assert_called_with(
         w.autoreloader.on_event_loop_close, )