/usr/lib/python2.7/dist-packages/kombu/tests/async/test_hub.py is in python-kombu 3.0.33-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | from __future__ import absolute_import
from kombu.async import hub as _hub
from kombu.async.hub import Hub, get_event_loop, set_event_loop
from kombu.tests.case import Case
class test_Utils(Case):
def setUp(self):
self._prev_loop = get_event_loop()
def tearDown(self):
set_event_loop(self._prev_loop)
def test_get_set_event_loop(self):
set_event_loop(None)
self.assertIsNone(_hub._current_loop)
self.assertIsNone(get_event_loop())
hub = Hub()
set_event_loop(hub)
self.assertIs(_hub._current_loop, hub)
self.assertIs(get_event_loop(), hub)
class test_Hub(Case):
def setUp(self):
self.hub = Hub()
def tearDown(self):
self.hub.close()
|