Commit ae899e2a authored by Jeremy Hylton's avatar Jeremy Hylton

Finish configuration for DemoStorage.

There's now concrete test of recursively defined section types.
parent 8713bd6a
......@@ -13,7 +13,7 @@
##############################################################################
"""Open database and storage from a configuration.
$Id: config.py,v 1.2 2003/01/03 21:19:06 fdrake Exp $"""
$Id: config.py,v 1.3 2003/01/06 22:42:17 jeremy Exp $"""
import os
import StringIO
......@@ -63,6 +63,18 @@ class MappingStorage(StorageConfig):
from ZODB.MappingStorage import MappingStorage
return MappingStorage(self.config.name)
class DemoStorage(StorageConfig):
def open(self):
from ZODB.DemoStorage import DemoStorage
if self.config.base:
base = self.config.base.open()
else:
base = None
return DemoStorage(self.config.name,
base=base,
quota=self.config.quota)
class FileStorage(StorageConfig):
def open(self):
......
......@@ -56,8 +56,7 @@
<key name="read_only_fallback" datatype="boolean" default="off"/>
</sectiontype>
<sectiontype type="demostorage">
<!--datatype="ZODB.config.DemoStorage"-->
<sectiontype type="demostorage" datatype="ZODB.config.DemoStorage">
<key name="name" default="Demo Storage"/>
<section type="storage" name="*" attribute="base"/>
<key name="quota" datatype="integer"/>
......
......@@ -76,6 +76,15 @@ class ZODBConfigTest(ConfigTestBase):
"""
self.assertRaises(ClientDisconnected, self._test, cfg)
def test_demo_config(self):
cfg = """
<demostorage>
name foo
<mappingstorage/>
</demostorage>
"""
self._test(cfg)
class BDBConfigTest(ConfigTestBase):
def setUp(self):
self._path = tempfile.mktemp()
......
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