Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
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
Ivan Tyagov
cloudooo
Commits
a4a3dfd8
Commit
a4a3dfd8
authored
Jun 08, 2011
by
Priscila Manhaes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor to use cloudoootestcase
parent
f530b4ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
cloudooo/handler/ooo/tests/testOooHighLoad.py
cloudooo/handler/ooo/tests/testOooHighLoad.py
+5
-11
No files found.
cloudooo/handler/ooo/tests/testOooHighLoad.py
View file @
a4a3dfd8
...
...
@@ -26,37 +26,31 @@
#
##############################################################################
from
xmlrpclib
import
ServerProxy
from
base64
import
encodestring
,
decodestring
from
multiprocessing
import
Process
,
Array
from
cloudooo.tests.
handlerTestCase
import
Handler
TestCase
,
make_suite
from
cloudooo.tests.
cloudoooTestCase
import
TestCase
,
make_suite
import
magic
DAEMON
=
True
mime_decoder
=
magic
.
Magic
(
mime
=
True
)
def
basicTestToGenerate
(
id
,
proxy
,
data
,
source_format
,
destination_format
,
result_list
):
"""Test to use method generate of server"""
document
=
proxy
.
convertFile
(
data
,
source_format
,
destination_format
)
document
=
proxy
.
convertFile
(
encodestring
(
data
)
,
source_format
,
destination_format
)
mimetype
=
mime_decoder
.
from_buffer
(
decodestring
(
document
))
assert
mimetype
==
'application/pdf'
result_list
[
id
]
=
True
class
TestHighLoad
(
Handler
TestCase
):
class
TestHighLoad
(
TestCase
):
"""Test with many simultaneous connection"""
def
afterSetUp
(
self
):
"""Creates connection with cloudooo Server"""
self
.
proxy
=
ServerProxy
(
"http://%s:%s"
%
(
self
.
hostname
,
self
.
cloudooo_port
))
def
testGenerateHighLoad
(
self
):
"""Sends many request to Server. Calling generate method"""
process_list
=
[]
data
=
encodestring
(
open
(
"data/test.doc"
,
'r'
).
read
()
)
LOOP
=
100
data
=
open
(
"data/test.doc"
,
'r'
).
read
(
)
LOOP
=
2
result_list
=
Array
(
'i'
,
[
False
]
*
LOOP
)
for
id
in
range
(
LOOP
):
process
=
Process
(
target
=
basicTestToGenerate
,
args
=
(
id
,
self
.
proxy
,
data
,
...
...
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