Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_hub.py 751B

123456789101112131415161718192021222324252627282930313233
  1. from __future__ import absolute_import
  2. from kombu.async import hub as _hub
  3. from kombu.async.hub import Hub, get_event_loop, set_event_loop
  4. from kombu.tests.case import Case
  5. class test_Utils(Case):
  6. def setUp(self):
  7. self._prev_loop = get_event_loop()
  8. def tearDown(self):
  9. set_event_loop(self._prev_loop)
  10. def test_get_set_event_loop(self):
  11. set_event_loop(None)
  12. self.assertIsNone(_hub._current_loop)
  13. self.assertIsNone(get_event_loop())
  14. hub = Hub()
  15. set_event_loop(hub)
  16. self.assertIs(_hub._current_loop, hub)
  17. self.assertIs(get_event_loop(), hub)
  18. class test_Hub(Case):
  19. def setUp(self):
  20. self.hub = Hub()
  21. def tearDown(self):
  22. self.hub.close()