예제 #1
0
파일: test_hub.py 프로젝트: jesper/kombu
 def test_is_in_blocking_section_with_loop(self):
     hub = Hub()
     set_event_loop(hub)
     self.assertFalse(is_in_blocking_section())
     with maybe_block():
         self.assertTrue(is_in_blocking_section())
     self.assertFalse(is_in_blocking_section())
예제 #2
0
파일: test_hub.py 프로젝트: jesper/kombu
 def test_maybe_block_with_loop(self):
     hub = ContextMock(name='hub')
     set_event_loop(hub)
     with maybe_block():
         pass
     hub.maybe_block.assert_called_with()
예제 #3
0
파일: test_hub.py 프로젝트: jesper/kombu
 def test_maybe_block_without_loop(self):
     set_event_loop(None)
     with maybe_block():
         pass