[Zope-Checkins] CVS: Zope/lib/python/OFS/tests - testRanges.py:1.7
Shane Hathaway
shane@digicool.com
Fri, 19 Oct 2001 12:37:31 -0400
Update of /cvs-repository/Zope/lib/python/OFS/tests
In directory cvs.zope.org:/tmp/cvs-serv9062/tests
Modified Files:
testRanges.py
Log Message:
The range tests don't really require Data.fs.in if we just create an
Application instance on the fly.
=== Zope/lib/python/OFS/tests/testRanges.py 1.6 => 1.7 ===
import string, whrandom, cStringIO, time, re
import ZODB
+from OFS.Application import Application
from OFS.Folder import manage_addFolder
from OFS.Image import manage_addFile
from Testing.makerequest import makerequest
@@ -96,13 +97,12 @@
def makeConnection():
import ZODB
- from ZODB.FileStorage import FileStorage
from ZODB.DemoStorage import DemoStorage
dfi = os.path.join( os.environ['SOFTWARE_HOME']
, '..', '..', 'var', 'Data.fs.in')
dfi = os.path.abspath(dfi)
- s = DemoStorage(base=FileStorage(dfi, read_only=1), quota=(1<<20))
+ s = DemoStorage(quota=(1<<20))
return ZODB.DB( s ).open()
def createBigFile():
@@ -127,7 +127,10 @@
self.responseOut = cStringIO.StringIO()
self.connection = makeConnection()
try:
- self.root = self.connection.root()[ 'Application' ]
+ r = self.connection.root()
+ a = Application()
+ r['Application'] = a
+ self.root = a
self.app = makerequest(self.root, stdout=self.responseOut)
try: self.app._delObject(TESTFOLDER_NAME)
except AttributeError: pass