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
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
Nikola Balog
wendelin
Commits
161faffd
Commit
161faffd
authored
Jan 09, 2023
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup empty spaces.
parent
22330fa6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
...tTemplateItem/portal_components/test.erp5.testWendelin.py
+20
-20
No files found.
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
View file @
161faffd
...
...
@@ -74,8 +74,8 @@ class Test(ERP5TypeTestCase):
# add brand new ingestion
reference
=
getRandomString
()
ingestion_policy
,
data_supply
,
_
=
portal
.
portal_ingestion_policies
.
IngestionPolicyTool_addIngestionPolicy
(
reference
=
reference
,
title
=
reference
,
reference
=
reference
,
title
=
reference
,
batch_mode
=
1
)
self
.
tic
()
...
...
@@ -120,7 +120,7 @@ class Test(ERP5TypeTestCase):
# try sample transformation
data_array
=
portal
.
data_array_module
.
newContent
(
portal_type
=
'Data Array'
,
portal_type
=
'Data Array'
,
reference
=
reference
)
data_array
.
validate
()
self
.
tic
()
...
...
@@ -151,7 +151,7 @@ class Test(ERP5TypeTestCase):
"""
portal
=
self
.
portal
reference
=
getRandomString
()
row
=
','
.
join
([
'%s'
%
x
for
x
in
range
(
1000
)])
number_string_list
=
[
row
]
*
20
real_data
=
'
\
n
'
.
join
(
number_string_list
)
...
...
@@ -162,11 +162,11 @@ class Test(ERP5TypeTestCase):
data_stream
.
appendData
(
real_data
)
data_stream
.
validate
()
data_array
=
portal
.
data_array_module
.
newContent
(
portal_type
=
'Data Array'
,
portal_type
=
'Data Array'
,
reference
=
reference
)
data_array
.
validate
()
self
.
tic
()
data_stream
.
DataStream_transform
(
\
chunk_length
=
len
(
row
),
\
transform_script_id
=
'DataStream_copyCSVToDataArray'
,
...
...
@@ -212,7 +212,7 @@ class Test(ERP5TypeTestCase):
persistent_zbig_array
[:,:]
=
new_array
self
.
assertEquals
(
new_array
.
shape
,
persistent_zbig_array
.
shape
)
self
.
assertTrue
(
np
.
array_equal
(
new_array
,
persistent_zbig_array
))
# test set element in zbig array
persistent_zbig_array
[:
2
,
2
]
=
0
self
.
assertFalse
(
np
.
array_equal
(
new_array
,
persistent_zbig_array
))
...
...
@@ -220,20 +220,20 @@ class Test(ERP5TypeTestCase):
# resize Zbig Array
persistent_zbig_array
=
np
.
resize
(
persistent_zbig_array
,
(
100
,
100
))
self
.
assertNotEquals
(
pure_numpy_array
.
shape
,
persistent_zbig_array
.
shape
)
# get array slice (fails)
data_array
=
self
.
portal
.
data_array_module
.
newContent
(
\
portal_type
=
'Data Array'
)
shape
=
(
1000
,)
data_array
.
initArray
(
shape
,
np
.
uint8
)
self
.
tic
()
persistent_zbig_array
=
data_array
.
getArray
()
new_array
=
np
.
arange
(
1000
)
new_array
.
resize
(
shape
)
self
.
assertEquals
(
new_array
.
shape
,
persistent_zbig_array
.
shape
)
persistent_zbig_array
[:,]
=
new_array
self
.
tic
()
...
...
@@ -248,29 +248,29 @@ class Test(ERP5TypeTestCase):
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
.
getBucketByKey
(
key
))
# test sequence
self
.
assertEqual
(
1
,
len
(
bucket_stream
))
# test delete bucket by key
bucket_stream
.
delBucketByKey
(
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
.
getBucketKeyItemSequenceByKey
(
start_key
=
10
,
count
=
1
)[
0
]
self
.
assertEqual
(
100000
,
bucket
[
1
].
value
)
...
...
@@ -288,9 +288,9 @@ class Test(ERP5TypeTestCase):
Test that nobody accidently removes needed by HowTo's default configurations.
"""
# the default json ingestion is usde in HowTo / Docs
self
.
assertNotEqual
(
None
,
self
.
assertNotEqual
(
None
,
getattr
(
self
.
portal
.
portal_ingestion_policies
,
"default"
,
None
))
self
.
assertNotEqual
(
None
,
self
.
assertNotEqual
(
None
,
getattr
(
self
.
portal
.
data_supply_module
,
"default"
,
None
))
def
test_07_LinkedDataStreamList
(
self
):
...
...
@@ -317,7 +317,7 @@ class Test(ERP5TypeTestCase):
data_stream_2
.
setSuccessorValue
(
data_stream_3
)
data_stream_3
.
setSuccessorValue
(
data_stream_4
)
data_stream_4
.
setSuccessorValue
(
data_stream_5
)
# set predecessor
data_stream_2
.
setPredecessorValue
(
data_stream_1
)
data_stream_3
.
setPredecessorValue
(
data_stream_2
)
...
...
@@ -329,7 +329,7 @@ class Test(ERP5TypeTestCase):
[
data_stream_3
,
data_stream_4
,
data_stream_5
])
self
.
assertSameSet
(
data_stream_5
.
getRecursiveSuccessorValueList
(),
\
[])
# test predecessor
self
.
assertSameSet
(
data_stream_1
.
getRecursivePredecessorValueList
(),
\
[])
...
...
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