Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
wendelin
Commits
bf2cdca7
Commit
bf2cdca7
authored
Aug 10, 2017
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs. Add test for bucket.
parent
3345371d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
4 deletions
+38
-4
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataBucketStream.py
...eItem/portal_components/document.erp5.DataBucketStream.py
+2
-1
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataBucketStream.xml
...Item/portal_components/document.erp5.DataBucketStream.xml
+2
-2
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
...tTemplateItem/portal_components/test.erp5.testWendelin.py
+34
-1
No files found.
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataBucketStream.py
View file @
bf2cdca7
...
...
@@ -35,7 +35,8 @@ from Products.ERP5Type.BTreeData import PersistentString
class
DataBucketStream
(
Document
):
"""
Represents data stored in many small files.
Represents data stored in many small files inside a "stream".
Each file is "addressed" by its key similar to dict.
"""
meta_type
=
'ERP5 Data Bucket Stream'
...
...
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataBucketStream.xml
View file @
bf2cdca7
...
...
@@ -46,8 +46,8 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 5
4
, 21: Redefining built-in \'id\' (redefined-builtin)
</string>
<string>
W: 6
7
, 18: Redefining built-in \'id\' (redefined-builtin)
</string>
<string>
W: 5
5
, 21: Redefining built-in \'id\' (redefined-builtin)
</string>
<string>
W: 6
8
, 18: Redefining built-in \'id\' (redefined-builtin)
</string>
</tuple>
</value>
</item>
...
...
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
View file @
bf2cdca7
...
...
@@ -308,3 +308,36 @@ context.activate().DataStream_readChunkListAndTransform( \
np
.
array_equal
(
data_array
.
getArraySlice
(
0
,
100
),
\
new_array
[:
100
]))
def
test_04_DataBucket
(
self
):
"""
Test data bucket
"""
bucket_stream
=
self
.
portal
.
data_stream_module
.
newContent
(
\
portal_type
=
'Data Bucket Stream'
)
self
.
tic
()
self
.
assertEqual
(
0
,
len
(
bucket_stream
))
# test set and get
bin_string
=
"1"
*
100000
key
=
len
(
bucket_stream
)
+
1
bucket_stream
.
insertBucket
(
key
,
bin_string
)
self
.
assertEqual
(
bin_string
,
bucket_stream
.
getBucket
(
key
))
# test sequence
self
.
assertEqual
(
1
,
len
(
bucket_stream
))
# test pop
bucket_stream
.
popBucket
(
key
)
self
.
assertEqual
(
0
,
len
(
bucket_stream
))
# set many buckets
for
i
in
range
(
100
):
bucket_stream
.
insertBucket
(
i
,
i
*
10000
)
self
.
assertEqual
(
100
,
len
(
bucket_stream
))
self
.
assertEqual
(
range
(
100
),
bucket_stream
.
getKeyList
())
# test as sequence
bucket
=
bucket_stream
.
getBucketItemSequence
(
start_key
=
10
,
count
=
1
)[
0
]
self
.
assertEqual
(
100000
,
bucket
[
1
].
value
)
\ No newline at end of file
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