Skip to content

Commit

Permalink
ZConfig wants strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
alga committed Mar 6, 2013
1 parent d8bc34c commit 29b33f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/ZEO/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@

import thread
from thread import get_ident

try:
from cStringIO import StringIO
except:
from io import StringIO
10 changes: 5 additions & 5 deletions src/ZEO/tests/testConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ def test_zeo_config(self):
from ZEO.ClientStorage import ClientDisconnected
import ZConfig
from ZODB.config import getDbSchema
from ZEO._compat import BytesIO
cfg = b"""
from ZEO._compat import StringIO
cfg = """
<zodb>
<zeoclient>
server localhost:56897
wait false
</zeoclient>
</zodb>
"""
config, handle = ZConfig.loadConfigFile(getDbSchema(), BytesIO(cfg))
config, handle = ZConfig.loadConfigFile(getDbSchema(), StringIO(cfg))
self.assertEqual(config.database[0].config.storage.config.blob_dir,
None)
self.assertRaises(ClientDisconnected, self._test, cfg)

cfg = b"""
cfg = """
<zodb>
<zeoclient>
blob-dir blobs
Expand All @@ -55,7 +55,7 @@ def test_zeo_config(self):
</zeoclient>
</zodb>
"""
config, handle = ZConfig.loadConfigFile(getDbSchema(), BytesIO(cfg))
config, handle = ZConfig.loadConfigFile(getDbSchema(), StringIO(cfg))
self.assertEqual(config.database[0].config.storage.config.blob_dir,
'blobs')
self.assertRaises(ClientDisconnected, self._test, cfg)
Expand Down

0 comments on commit 29b33f5

Please sign in to comment.