Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tempstorage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
tempstorage
Commits
1a4fbe99
Commit
1a4fbe99
authored
Sep 25, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More PEP8 cleanup
parent
4db38902
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
16 deletions
+14
-16
src/tempstorage/__init__.py
src/tempstorage/__init__.py
+0
-2
src/tempstorage/component.xml
src/tempstorage/component.xml
+0
-2
src/tempstorage/config.py
src/tempstorage/config.py
+3
-0
src/tempstorage/tests/__init__.py
src/tempstorage/tests/__init__.py
+0
-1
src/tempstorage/tests/testTemporaryStorage.py
src/tempstorage/tests/testTemporaryStorage.py
+11
-11
No files found.
src/tempstorage/__init__.py
View file @
1a4fbe99
...
...
@@ -11,5 +11,3 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
""" tempstorage package
"""
src/tempstorage/component.xml
View file @
1a4fbe99
...
...
@@ -10,5 +10,3 @@
</sectiontype>
</component>
src/tempstorage/config.py
View file @
1a4fbe99
...
...
@@ -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
)
src/tempstorage/tests/__init__.py
View file @
1a4fbe99
...
...
@@ -11,4 +11,3 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
# make this a package.
src/tempstorage/tests/testTemporaryStorage.py
View file @
1a4fbe99
...
...
@@ -11,6 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import
unittest
from
ZODB.tests
import
StorageTestBase
...
...
@@ -19,9 +20,8 @@ from ZODB.tests import Synchronization
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 @@ class TemporaryStorageTests(unittest.TestCase):
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 @@ class TemporaryStorageTests(unittest.TestCase):
# 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 @@ class TemporaryStorageTests(unittest.TestCase):
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,13 +164,13 @@ class TemporaryStorageTests(unittest.TestCase):
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
((
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment