Skip to content

Commit

Permalink
Add coverage for 'ZEO.client' convenience function.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Jan 18, 2018
1 parent 9a42451 commit 7c1eb8f
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/ZEO/tests/testZEO.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,30 @@ def __getstate__(self):
return super(CreativeGetState, self).__getstate__()


class DummyClientThread(object):
def __init__(self, *args, **kw):
self._args = args
self._kw = kw
def call(self):
pass
def async(self):
pass
def async_iter(self):
pass
def wait(self):
pass


class Test_convenience_functions(unittest.TestCase):

def test_ZEO_client_convenience(self):
import ZEO

client = ZEO.client(
8001, wait=False, _client_factory=DummyClientThread)
self.assertIsInstance(client, ClientStorage)


class MiscZEOTests(object):
"""ZEO tests that don't fit in elsewhere."""

Expand Down Expand Up @@ -1636,7 +1660,9 @@ def pack(self, t=None, referencesf=None):
ZEO.ClientStorage._check_blob_cache_size(self.blob_dir, 0)

def test_suite():
suite = unittest.TestSuite()
suite = unittest.TestSuite((
unittest.makeSuite(Test_convenience_functions),
))

zeo = unittest.TestSuite()
zeo.addTest(unittest.makeSuite(ZODB.tests.util.AAAA_Test_Runner_Hack))
Expand Down

0 comments on commit 7c1eb8f

Please sign in to comment.