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
Roque
wendelin
Commits
17800924
Commit
17800924
authored
Oct 18, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! fixup! IngestionPolicy: accept data chunk as application/octet-stream
parent
d97f39bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
...tTemplateItem/portal_components/test.erp5.testWendelin.py
+11
-8
No files found.
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
View file @
17800924
...
...
@@ -29,9 +29,7 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
wendelin.bigarray.array_zodb
import
ZBigArray
from
DateTime
import
DateTime
from
zExceptions
import
NotFound
from
cStringIO
import
StringIO
import
httplib
import
msgpack
import
numpy
as
np
import
string
...
...
@@ -113,10 +111,15 @@ class Test(ERP5TypeTestCase):
body
=
urllib
.
urlencode
({
'data_chunk'
:
body
})
else
:
env
=
{
'CONTENT_TYPE'
:
'application/octet-stream'
}
response
=
self
.
publish
(
ingestion_policy
.
getPath
()
+
'/ingest?reference='
+
reference
,
'ERP5TypeTestCase:'
,
env
,
request_method
=
'POST'
,
stdin
=
StringIO
(
body
))
self
.
assertEqual
(
httplib
.
NO_CONTENT
,
response
.
getStatus
())
path
=
ingestion_policy
.
getPath
()
+
'/ingest?reference='
+
reference
publish_kw
=
dict
(
basic
=
'ERP5TypeTestCase:'
,
env
=
env
,
request_method
=
'POST'
,
stdin
=
StringIO
(
body
))
response
=
self
.
publish
(
path
,
**
publish_kw
)
# Due to inconsistencies in the Zope framework,
# a normal instance returns 204. As explained at
# http://blog.ploeh.dk/2013/04/30/rest-lesson-learned-avoid-204-responses/
# turning 200 into 204 automatically when the body is empty is questionable.
self
.
assertEqual
(
200
,
response
.
getStatus
())
data_stream_data
=
data_stream
.
getData
()
self
.
assertEqual
(
real_data
,
data_stream_data
)
...
...
@@ -135,8 +138,8 @@ class Test(ERP5TypeTestCase):
self
.
assertTrue
(
np
.
array_equal
(
zarray
,
np
.
arange
(
100001
)))
# test ingesting with bad reference and raise of NotFound
re
quest
.
set
(
'reference'
,
reference
+
'not_existing'
)
self
.
assert
Raises
(
NotFound
,
ingestion_policy
.
ingest
)
re
sponse
=
self
.
publish
(
path
+
'_not_existing'
,
**
publish_kw
)
self
.
assert
Equal
(
404
,
response
.
getStatus
()
)
def
test_01_1_IngestionFromOldFluentd
(
self
):
self
.
test_01_IngestionFromFluentd
(
True
)
...
...
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