[Checkins] SVN: tempstorage/trunk/src/tempstorage/ More PEP8 cleanup
Hanno Schlichting
hannosch at hannosch.eu
Sat Sep 25 09:11:57 EDT 2010
Log message for revision 116898:
More PEP8 cleanup
Changed:
U tempstorage/trunk/src/tempstorage/__init__.py
U tempstorage/trunk/src/tempstorage/component.xml
U tempstorage/trunk/src/tempstorage/config.py
U tempstorage/trunk/src/tempstorage/tests/__init__.py
U tempstorage/trunk/src/tempstorage/tests/testTemporaryStorage.py
-=-
Modified: tempstorage/trunk/src/tempstorage/__init__.py
===================================================================
--- tempstorage/trunk/src/tempstorage/__init__.py 2010-09-25 13:11:48 UTC (rev 116897)
+++ tempstorage/trunk/src/tempstorage/__init__.py 2010-09-25 13:11:57 UTC (rev 116898)
@@ -11,5 +11,3 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-""" tempstorage package
-"""
Modified: tempstorage/trunk/src/tempstorage/component.xml
===================================================================
--- tempstorage/trunk/src/tempstorage/component.xml 2010-09-25 13:11:48 UTC (rev 116897)
+++ tempstorage/trunk/src/tempstorage/component.xml 2010-09-25 13:11:57 UTC (rev 116898)
@@ -10,5 +10,3 @@
</sectiontype>
</component>
-
-
Modified: tempstorage/trunk/src/tempstorage/config.py
===================================================================
--- tempstorage/trunk/src/tempstorage/config.py 2010-09-25 13:11:48 UTC (rev 116897)
+++ tempstorage/trunk/src/tempstorage/config.py 2010-09-25 13:11:57 UTC (rev 116898)
@@ -11,9 +11,12 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
+
from ZODB.config import BaseConfig
+
class TemporaryStorage(BaseConfig):
+
def open(self):
from tempstorage.TemporaryStorage import TemporaryStorage
return TemporaryStorage(self.config.name)
Modified: tempstorage/trunk/src/tempstorage/tests/__init__.py
===================================================================
--- tempstorage/trunk/src/tempstorage/tests/__init__.py 2010-09-25 13:11:48 UTC (rev 116897)
+++ tempstorage/trunk/src/tempstorage/tests/__init__.py 2010-09-25 13:11:57 UTC (rev 116898)
@@ -11,4 +11,3 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-# make this a package.
Modified: tempstorage/trunk/src/tempstorage/tests/testTemporaryStorage.py
===================================================================
--- tempstorage/trunk/src/tempstorage/tests/testTemporaryStorage.py 2010-09-25 13:11:48 UTC (rev 116897)
+++ tempstorage/trunk/src/tempstorage/tests/testTemporaryStorage.py 2010-09-25 13:11:57 UTC (rev 116898)
@@ -11,6 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
+
import unittest
from ZODB.tests import StorageTestBase
@@ -19,9 +20,8 @@
from ZODB.tests import ConflictResolution
from ZODB.tests import MTStorage
+
class ZODBProtocolTests(StorageTestBase.StorageTestBase,
- # not a revision storage, but passes
- #RevisionStorage.RevisionStorage,
BasicStorage.BasicStorage,
Synchronization.SynchronizedStorage,
ConflictResolution.ConflictResolvingStorage,
@@ -105,7 +105,7 @@
tm2 = transaction.TransactionManager()
cn2 = db.open(transaction_manager=tm2)
r2 = cn2.root()
- ignored = r2["p"] # force a read to unghostify the root.
+ r2["p"]._p_activate()
self.assertEqual(r1._p_serial, r2._p_serial)
@@ -120,7 +120,7 @@
# in the transaction and obj was modified by the other
# transaction.
- obj.child1
+ obj.child1
return obj
def test_conflict_cache_clears_over_time(self):
@@ -131,22 +131,22 @@
storage._conflict_cache_maxage = 1 # second
oid = storage.new_oid()
- self._dostore(storage,oid, data=MinPO(5))
+ self._dostore(storage, oid, data=MinPO(5))
time.sleep(2)
oid2 = storage.new_oid()
- self._dostore(storage,oid2, data=MinPO(10))
+ self._dostore(storage, oid2, data=MinPO(10))
oid3 = storage.new_oid()
- self._dostore(storage,oid3, data=MinPO(9))
+ self._dostore(storage, oid3, data=MinPO(9))
self.assertEqual(len(storage._conflict_cache), 2)
time.sleep(2)
oid4 = storage.new_oid()
- self._dostore(storage,oid4, data=MinPO(11))
+ self._dostore(storage, oid4, data=MinPO(11))
self.assertEqual(len(storage._conflict_cache), 1)
@@ -164,14 +164,14 @@
from ZODB.tests.MinPO import MinPO
storage = self._makeOne()
oid = storage.new_oid()
- self._dostore(storage,oid, data=MinPO(1))
- loadp, loads = storage.load(oid, 'whatever')
+ self._dostore(storage, oid, data=MinPO(1))
+ loadp, loads = storage.load(oid, 'whatever')
exp, exs, exv = storage.loadEx(oid, 'whatever')
self.assertEqual(loadp, exp)
self.assertEqual(loads, exs)
self.assertEqual(exv, '')
-
+
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(TemporaryStorageTests),
More information about the checkins
mailing list