Commit 21c2c799 authored by Chris Rossi's avatar Chris Rossi

Allow ability to pass dbkw args in zconfig uris

parent 7c3f7b75
......@@ -178,7 +178,7 @@ class ZConfigURIResolver(object):
break
else:
raise KeyError("No storage named %s found" % frag)
return factory.open, {}
return factory.open, dict(cgi.parse_qsl(query))
client_storage_resolver = ClientStorageURIResolver()
......
......@@ -295,6 +295,19 @@ class TestZConfigURIResolver(unittest.TestCase):
from ZODB.MappingStorage import MappingStorage
self.assertTrue(isinstance(storage, MappingStorage))
def test_query_string_args(self):
self.tmp.write("""
<mappingstorage>
</mappingstorage>
<demostorage demo>
</demostorage>
""")
self.tmp.flush()
resolver = self._makeOne()
factory, dbkw = resolver('zconfig://%s?foo=bar' % self.tmp.name)
self.assertEqual(dbkw, {'foo': 'bar'})
def test_database_not_found(self):
self.tmp.write("""
<mappingstorage x>
......
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