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
3
Merge Requests
3
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
nexedi
wendelin
Commits
98d77b78
Commit
98d77b78
authored
Sep 20, 2019
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend test to cover data upload.
Upload 1Mb of data.
parent
96868dd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
scalability_test/example/createDataStream.py
scalability_test/example/createDataStream.py
+9
-6
No files found.
scalability_test/example/createDataStream.py
View file @
98d77b78
# -*- coding: utf-8 -*-
import
io
import
datetime
import
random
import
time
...
...
@@ -29,7 +29,7 @@ def createDataStream(result, browser):
browser
.
mainForm
.
submitSelectModule
(
value
=
'/data_stream_module'
,
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
# Create a newData Stream
(XXX: this will create Data Stream Bucket!)
# Create a newData Stream
result
(
'Create'
,
browser
.
mainForm
.
submitNew
(
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
...
...
@@ -40,12 +40,15 @@ def createDataStream(result, browser):
# Fill the title
my_title
=
PREFIX_TITLE
+
generateString
(
6
)
browser
.
mainForm
.
getControl
(
name
=
'field_my_title'
).
value
=
my_title
# Set some random informations
browser
.
mainForm
.
getControl
(
name
=
'field_my_reference'
).
value
=
generateString
(
6
)
my_str
=
generateString
(
random
.
randint
(
1
,
100
))
browser
.
mainForm
.
getControl
(
name
=
'field_my_description'
).
value
=
my_str
result
(
'Save'
,
browser
.
mainForm
.
submitSave
(
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
# XXX: how to upload data?
# tests upload data from file of 1Mb size
ctrl
=
browser
.
mainForm
.
getControl
(
name
=
'field_my_file'
)
ctrl
.
add_file
(
io
.
BytesIO
(
generateString
(
1024
)
*
1024
),
'text/plain'
,
'test.txt'
)
# Submit the changes, record the time elapsed in seconds
result
(
'Save'
,
...
...
@@ -53,10 +56,10 @@ def createDataStream(result, browser):
# Check whether the changes have been successfully updated
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
sale_order_url
=
my_order_sale_url
# Validate the Data Stream
#browser.mainForm.submitSelectWorkflow(value='validate_action')
#result('Validate',
# browser.mainForm.submitDialogConfirm(sleep=(TMIN_SLEEP, TMAX_SLEEP)))
#assert browser.getTransitionMessage() == 'Status changed.'
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