Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
b7d086a9
Commit
b7d086a9
authored
Oct 24, 2002
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor some non-FileStorage specific tests into RecoveryStorage.
parent
d411e289
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
51 deletions
+2
-51
src/ZODB/tests/testFileStorage.py
src/ZODB/tests/testFileStorage.py
+2
-51
No files found.
src/ZODB/tests/testFileStorage.py
View file @
b7d086a9
...
@@ -11,7 +11,7 @@ from ZODB.tests import StorageTestBase, BasicStorage, \
...
@@ -11,7 +11,7 @@ from ZODB.tests import StorageTestBase, BasicStorage, \
TransactionalUndoVersionStorage
,
PackableStorage
,
\
TransactionalUndoVersionStorage
,
PackableStorage
,
\
Synchronization
,
ConflictResolution
,
HistoryStorage
,
\
Synchronization
,
ConflictResolution
,
HistoryStorage
,
\
IteratorStorage
,
Corruption
,
RevisionStorage
,
PersistentStorage
,
\
IteratorStorage
,
Corruption
,
RevisionStorage
,
PersistentStorage
,
\
MTStorage
,
ReadOnlyStorage
MTStorage
,
ReadOnlyStorage
,
RecoveryStorage
class
FileStorageTests
(
class
FileStorageTests
(
StorageTestBase
.
StorageTestBase
,
StorageTestBase
.
StorageTestBase
,
...
@@ -63,7 +63,7 @@ class FileStorageTests(
...
@@ -63,7 +63,7 @@ class FileStorageTests(
class
FileStorageRecoveryTest
(
class
FileStorageRecoveryTest
(
StorageTestBase
.
StorageTestBase
,
StorageTestBase
.
StorageTestBase
,
IteratorStorage
.
IteratorDeepCompar
e
,
RecoveryStorage
.
RecoveryStorag
e
,
):
):
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -76,55 +76,6 @@ class FileStorageRecoveryTest(
...
@@ -76,55 +76,6 @@ class FileStorageRecoveryTest(
StorageTestBase
.
removefs
(
"Source.fs"
)
StorageTestBase
.
removefs
(
"Source.fs"
)
StorageTestBase
.
removefs
(
"Dest.fs"
)
StorageTestBase
.
removefs
(
"Dest.fs"
)
def
checkSimpleRecovery
(
self
):
oid
=
self
.
_storage
.
new_oid
()
revid
=
self
.
_dostore
(
oid
,
data
=
11
)
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
12
)
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
13
)
self
.
_dst
.
copyTransactionsFrom
(
self
.
_storage
)
self
.
compare
(
self
.
_storage
,
self
.
_dst
)
def
checkRecoveryAcrossVersions
(
self
):
oid
=
self
.
_storage
.
new_oid
()
revid
=
self
.
_dostore
(
oid
,
data
=
21
)
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
22
)
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
23
,
version
=
'one'
)
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
34
,
version
=
'one'
)
# Now commit the version
t
=
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
commitVersion
(
'one'
,
''
,
t
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
self
.
_dst
.
copyTransactionsFrom
(
self
.
_storage
)
self
.
compare
(
self
.
_storage
,
self
.
_dst
)
def
checkRecoverAbortVersion
(
self
):
oid
=
self
.
_storage
.
new_oid
()
revid
=
self
.
_dostore
(
oid
,
data
=
21
,
version
=
"one"
)
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
23
,
version
=
'one'
)
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
34
,
version
=
'one'
)
# Now abort the version and the creation
t
=
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
oids
=
self
.
_storage
.
abortVersion
(
'one'
,
t
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
self
.
assertEqual
(
oids
,
[
oid
])
self
.
_dst
.
copyTransactionsFrom
(
self
.
_storage
)
self
.
compare
(
self
.
_storage
,
self
.
_dst
)
# Also make sure the the last transaction has a data record
# with None for its data attribute, because we've undone the
# object.
for
s
in
self
.
_storage
,
self
.
_dst
:
iter
=
s
.
iterator
()
for
trans
in
iter
:
pass
# iterate until we get the last one
data
=
trans
[
0
]
self
.
assertRaises
(
IndexError
,
lambda
i
:
trans
[
i
],
1
)
self
.
assertEqual
(
data
.
oid
,
oid
)
self
.
assertEqual
(
data
.
data
,
None
)
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
makeSuite
(
FileStorageTests
,
'check'
)
suite
=
unittest
.
makeSuite
(
FileStorageTests
,
'check'
)
...
...
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