Commit 29b33f58 authored by Albertas Agejevas's avatar Albertas Agejevas

ZConfig wants strings.

parent d8bc34cc
...@@ -32,3 +32,8 @@ else: ...@@ -32,3 +32,8 @@ else:
import thread import thread
from thread import get_ident from thread import get_ident
try:
from cStringIO import StringIO
except:
from io import StringIO
...@@ -32,8 +32,8 @@ class ZEOConfigTest(ConfigTestBase): ...@@ -32,8 +32,8 @@ class ZEOConfigTest(ConfigTestBase):
from ZEO.ClientStorage import ClientDisconnected from ZEO.ClientStorage import ClientDisconnected
import ZConfig import ZConfig
from ZODB.config import getDbSchema from ZODB.config import getDbSchema
from ZEO._compat import BytesIO from ZEO._compat import StringIO
cfg = b""" cfg = """
<zodb> <zodb>
<zeoclient> <zeoclient>
server localhost:56897 server localhost:56897
...@@ -41,12 +41,12 @@ class ZEOConfigTest(ConfigTestBase): ...@@ -41,12 +41,12 @@ class ZEOConfigTest(ConfigTestBase):
</zeoclient> </zeoclient>
</zodb> </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, self.assertEqual(config.database[0].config.storage.config.blob_dir,
None) None)
self.assertRaises(ClientDisconnected, self._test, cfg) self.assertRaises(ClientDisconnected, self._test, cfg)
cfg = b""" cfg = """
<zodb> <zodb>
<zeoclient> <zeoclient>
blob-dir blobs blob-dir blobs
...@@ -55,7 +55,7 @@ class ZEOConfigTest(ConfigTestBase): ...@@ -55,7 +55,7 @@ class ZEOConfigTest(ConfigTestBase):
</zeoclient> </zeoclient>
</zodb> </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, self.assertEqual(config.database[0].config.storage.config.blob_dir,
'blobs') 'blobs')
self.assertRaises(ClientDisconnected, self._test, cfg) self.assertRaises(ClientDisconnected, self._test, cfg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment