Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
7a1d3c1a
Commit
7a1d3c1a
authored
7 years ago
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0bc7132f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
t/neo/storage/fs1/py/gen-testdata
t/neo/storage/fs1/py/gen-testdata
+22
-13
t/neo/storage/fs1/testdata/1.fs
t/neo/storage/fs1/testdata/1.fs
+0
-0
t/neo/storage/fs1/testdata/1.fs.index
t/neo/storage/fs1/testdata/1.fs.index
+0
-0
No files found.
t/neo/storage/fs1/py/gen-testdata
View file @
7a1d3c1a
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
# TODO author/copyright
# TODO author/copyright
"""generate reference database and index for tests"""
"""generate reference database and index for tests"""
# TODO generate transactions with backpointers
from
ZODB.FileStorage
import
FileStorage
from
ZODB.FileStorage
import
FileStorage
from
ZODB
import
DB
from
ZODB
import
DB
from
persistent
import
Persistent
from
persistent
import
Persistent
...
@@ -33,11 +31,15 @@ def xtime():
...
@@ -33,11 +31,15 @@ def xtime():
time
.
time
=
xtime
time
.
time
=
xtime
def
commit
(
user
,
description
,
extension
):
def
_pre
commit
(
user
,
description
,
extension
):
txn
=
transaction
.
get
()
txn
=
transaction
.
get
()
txn
.
user
=
user
txn
.
user
=
user
txn
.
description
=
description
txn
.
description
=
description
txn
.
extension
=
extension
txn
.
extension
=
extension
def
commit
(
user
,
description
,
extension
):
_precommit
(
user
,
description
,
extension
)
txn
=
transaction
.
get
()
txn
.
commit
()
txn
.
commit
()
...
@@ -67,16 +69,23 @@ def main():
...
@@ -67,16 +69,23 @@ def main():
random
.
seed
(
0
)
random
.
seed
(
0
)
namev
=
[
_
for
_
in
"abcdefg"
]
namev
=
[
_
for
_
in
"abcdefg"
]
for
i
in
range
(
50
):
for
i
in
range
(
2
):
for
j
in
range
(
25
):
name
=
random
.
choice
(
namev
)
name
=
random
.
choice
(
namev
)
if
name
in
root
:
if
name
in
root
:
obj
=
root
[
name
]
obj
=
root
[
name
]
else
:
else
:
root
[
name
]
=
obj
=
Object
(
None
)
root
[
name
]
=
obj
=
Object
(
None
)
obj
.
value
=
"%s%i"
%
(
name
,
i
)
obj
.
value
=
"%s%i.%i"
%
(
name
,
i
,
j
)
commit
(
u"user%i.%i"
%
(
i
,
j
),
u"step %i.%i"
%
(
i
,
j
),
{
"x-generator"
:
"zodb/py2 (%s)"
%
name
})
commit
(
u"user%i"
%
i
,
u"step %i"
%
i
,
{
"x-generator"
:
"zodb/py2 (%s)"
%
name
})
# undo a transaction one step before a latest one a couple of times
for
j
in
range
(
2
):
ul
=
db
.
undoLog
(
1
+
j
,
2
+
j
)[
0
]
_precommit
(
u"root%i.%i"
%
(
i
,
j
),
u"undo %i.%i"
%
(
i
,
j
),
{
"x-generator"
:
"zodb/py2 (undo %s)"
%
ul
[
"id"
]})
db
.
undo
(
ul
[
"id"
])
conn
.
close
()
conn
.
close
()
db
.
close
()
db
.
close
()
...
...
This diff is collapsed.
Click to expand it.
t/neo/storage/fs1/testdata/1.fs
View file @
7a1d3c1a
No preview for this file type
This diff is collapsed.
Click to expand it.
t/neo/storage/fs1/testdata/1.fs.index
View file @
7a1d3c1a
No preview for this file type
This diff is collapsed.
Click to expand it.
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