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
Ekaterina
wendelin
Commits
018f09db
Commit
018f09db
authored
Feb 05, 2020
by
Ekaterina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin: fix the test to get array by request
parent
35447649
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
...tTemplateItem/portal_components/test.erp5.testWendelin.py
+5
-14
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.xml
...TemplateItem/portal_components/test.erp5.testWendelin.xml
+1
-2
No files found.
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
View file @
018f09db
...
...
@@ -33,10 +33,7 @@ import numpy as np
import
string
import
random
import
urllib
import
requests
import
StringIO
as
st
from
Products.ERP5Type.Log
import
log
def
getRandomString
():
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
...
...
@@ -234,17 +231,11 @@ class Test(ERP5TypeTestCase):
np
.
array_equal
(
data_array
.
getArraySlice
(
0
,
100
),
\
new_array
[:
100
]))
# test get array by request if exists and chech that length is correct
data_arrays
=
self
.
portal
.
data_array_module
.
objectValues
()
spectrum_array
=
[
o
for
o
in
data_arrays
if
o
.
getTitle
()
==
'pydata-spectrum2'
]
if
len
(
spectrum_array
)
==
1
:
spectrum_array_id
=
spectrum_array
[
0
].
getId
()
headers
=
{
'Range'
:
'bytes=0-'
}
url
=
'https://softinst127199.host.vifib.net/erp5/web_site_module/pydata_runner/hateoas/data_array_module/'
+
spectrum_array_id
response
=
requests
.
get
(
url
,
auth
=
(
'zope'
,
'aybvtnkf'
),
headers
=
headers
)
response_string
=
st
.
StringIO
()
response_string
.
write
(
response
.
content
)
self
.
assertEquals
(
response_string
.
len
,
spectrum_array
[
0
].
getSize
())
# get array by request
path
=
'/erp5/data_array_module/'
+
data_array
.
getId
()
publish_kw
=
dict
(
user
=
'ERP5TypeTestCase'
,
env
=
{
'RANGE'
:
'bytes=0-'
},
request_method
=
'GET'
)
response
=
self
.
publish
(
path
,
**
publish_kw
)
self
.
assertEquals
(
int
(
response
.
headers
[
"content-length"
]),
data_array
.
getSize
())
def
test_04_DataBucket
(
self
):
"""
...
...
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.xml
View file @
018f09db
...
...
@@ -46,8 +46,7 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 67, 35: Unused variable \'data_product\' (unused-variable)
</string>
<string>
W: 39, 0: Unused log imported from Products.ERP5Type.Log (unused-import)
</string>
<string>
W: 64, 35: Unused variable \'data_product\' (unused-variable)
</string>
</tuple>
</value>
</item>
...
...
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