added get_readers/writers/excs methods to hubs.hub.Hub; made api_test.py use them
This commit is contained in:
@@ -321,3 +321,12 @@ class BaseHub(object):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_readers(self):
|
||||||
|
return self.readers
|
||||||
|
|
||||||
|
def get_writers(self):
|
||||||
|
return self.writers
|
||||||
|
|
||||||
|
def get_excs(self):
|
||||||
|
return self.excs
|
||||||
|
|
||||||
|
@@ -39,8 +39,8 @@ def check_hub():
|
|||||||
api.sleep(0)
|
api.sleep(0)
|
||||||
api.sleep(0)
|
api.sleep(0)
|
||||||
hub = api.get_hub()
|
hub = api.get_hub()
|
||||||
for nm in 'readers', 'writers', 'excs':
|
for nm in 'get_readers', 'get_writers', 'get_excs':
|
||||||
dct = getattr(hub, nm)
|
dct = getattr(hub, nm)()
|
||||||
assert not dct, "hub.%s not empty: %s" % (nm, dct)
|
assert not dct, "hub.%s not empty: %s" % (nm, dct)
|
||||||
# Stop the runloop
|
# Stop the runloop
|
||||||
api.get_hub().abort()
|
api.get_hub().abort()
|
||||||
@@ -85,7 +85,7 @@ class TestApi(tests.TestCase):
|
|||||||
|
|
||||||
check_hub()
|
check_hub()
|
||||||
|
|
||||||
def test_connect_ssl(self):
|
def test_connect_ssl(self):
|
||||||
def accept_once(listenfd):
|
def accept_once(listenfd):
|
||||||
try:
|
try:
|
||||||
conn, addr = listenfd.accept()
|
conn, addr = listenfd.accept()
|
||||||
|
Reference in New Issue
Block a user