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
Charles
wendelin
Commits
9fa5088a
Commit
9fa5088a
authored
Jun 22, 2015
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test stand alone.
parent
34dc75cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
14 deletions
+28
-14
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
...tTemplateItem/portal_components/test.erp5.testWendelin.py
+23
-9
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.xml
...TemplateItem/portal_components/test.erp5.testWendelin.xml
+5
-5
No files found.
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
View file @
9fa5088a
...
...
@@ -32,6 +32,10 @@ import numpy as np
import
string
import
random
def
getRandomString
():
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
n
in
xrange
(
32
)])
class
Test
(
ERP5TypeTestCase
):
"""
Wendelin Test
...
...
@@ -66,32 +70,43 @@ class Test(ERP5TypeTestCase):
request
=
portal
.
REQUEST
# simulate fluentd by setting proper values in REQUEST
reference
=
getRandomString
()
number_list
=
range
(
11
)
request
.
method
=
'POST'
real_data
=
(
'%s
\
n
'
%
','
.
join
([
str
(
x
)
for
x
in
number_list
]))
*
10000
data_chunk
=
msgpack
.
packb
([
0
,
real_data
],
use_bin_type
=
True
)
request
.
set
(
'reference'
,
'car'
)
request
.
set
(
'reference'
,
reference
)
request
.
set
(
'data_chunk'
,
data_chunk
)
ingestion_policy
=
portal
.
portal_ingestion_policies
.
wendelin_car_logs
# create ingestion policy
ingestion_policy
=
portal
.
portal_ingestion_policies
.
newContent
(
\
portal_type
=
'Ingestion Policy'
,
reference
=
reference
,
version
=
'001'
,
script_id
=
'ERP5Site_handleDefaultFluentdIngestion'
)
ingestion_policy
.
validate
()
# create sensor
sensor
=
portal
.
sensor_module
.
newContent
(
\
portal_type
=
'Sensor'
,
reference
=
reference
)
sensor
.
validate
()
# create new Data Stream for test purposes
data_stream
=
portal
.
data_stream_module
.
newContent
(
\
portal_type
=
'Data Stream'
,
\
reference
=
'car'
)
reference
=
reference
)
data_stream
.
validate
()
# create Data Supply
resource
=
portal
.
restrictedTraverse
(
'data_product_module/wendelin_4'
)
sensor
=
portal
.
restrictedTraverse
(
'sensor_module/wendelin_1'
)
data_supply_kw
=
{
'reference'
:
'car'
,
data_supply_kw
=
{
'reference'
:
reference
,
'version'
:
'001'
,
'start_date'
:
now
,
'stop_date'
:
now
+
365
}
data_supply_line_kw
=
{
'resource_value'
:
resource
,
'source_section_value'
:
sensor
,
'destination_section_value'
:
data_stream
}
data_supply
=
ingestion_policy
.
PortalIngestionPolicy_addDataSupply
(
\
data_supply_kw
,
\
data_supply_line_kw
)
...
...
@@ -106,8 +121,7 @@ class Test(ERP5TypeTestCase):
self
.
assertEqual
(
'
\
n
%s'
%
real_data
,
data_stream_data
)
# XXX: get rid of new line in ingest script!
# try sample transformation
reference
=
'test-data-array- %s'
\
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
for
n
in
xrange
(
32
)])
reference
=
'test-data-array- %s'
%
getRandomString
()
data_array
=
portal
.
data_array_module
.
newContent
(
portal_type
=
'Data Array'
,
...
...
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.xml
View file @
9fa5088a
...
...
@@ -46,11 +46,11 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:
55, 4: Unused variable \'scipy
\' (unused-variable)
</string>
<string>
W: 5
7, 4: Unused variable \'pandas
\' (unused-variable)
</string>
<string>
W:
56, 4: Unused variable \'sklearn
\' (unused-variable)
</string>
<string>
W:
95, 4: Unused variable \'data_supply
\' (unused-variable)
</string>
<string>
W:110,
72: Unused variable \'n
\' (unused-variable)
</string>
<string>
W:
37, 8: Unused variable \'n
\' (unused-variable)
</string>
<string>
W: 5
9, 4: Unused variable \'scipy
\' (unused-variable)
</string>
<string>
W:
61, 4: Unused variable \'pandas
\' (unused-variable)
</string>
<string>
W:
60, 4: Unused variable \'sklearn
\' (unused-variable)
</string>
<string>
W:110,
4: Unused variable \'data_supply
\' (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