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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
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
Hide 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