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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
cloudooo
Commits
af933eee
Commit
af933eee
authored
Jun 01, 2011
by
Priscila Manhaes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TYPO
parent
30c8240a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
49 deletions
+49
-49
cloudooo/handler/ooo/tests/testServer.py
cloudooo/handler/ooo/tests/testServer.py
+49
-49
No files found.
cloudooo/handler/ooo/tests/testServer.py
View file @
af933eee
...
@@ -34,44 +34,44 @@ from cloudooo.tests.cloudoooTestCase import TestCase, make_suite
...
@@ -34,44 +34,44 @@ from cloudooo.tests.cloudoooTestCase import TestCase, make_suite
class
TestServer
(
TestCase
):
class
TestServer
(
TestCase
):
"""Test XmlRpc Server. Needs cloudooo server started"""
"""Test XmlRpc Server. Needs cloudooo server started"""
#
def ConversionScenarioList(self):
def
ConversionScenarioList
(
self
):
#
return [
return
[
#
# Test Convert Doc -> Odt
# Test Convert Doc -> Odt
#
(join('data', 'test.doc'), "doc", "odt", "application/vnd.oasis."+
(
join
(
'data'
,
'test.doc'
),
"doc"
,
"odt"
,
"application/vnd.oasis."
+
#
"opendocument.text"),
"opendocument.text"
),
#
# Test export png to svg
# Test export png to svg
#
(join('data', 'test.png'), "png", "svg", "image/svg+xml"),
(
join
(
'data'
,
'test.png'
),
"png"
,
"svg"
,
"image/svg+xml"
),
#
# Test export docx to odt
# Test export docx to odt
#
(join('data', 'test.docx'), "docx", "odt", "application/vnd.oasis."+
(
join
(
'data'
,
'test.docx'
),
"docx"
,
"odt"
,
"application/vnd.oasis."
+
#
"opendocument.text"),
"opendocument.text"
),
#
# Test export python to pdf
# Test export python to pdf
#
(__file__, "py", "pdf", "application/pdf"),
(
__file__
,
"py"
,
"pdf"
,
"application/pdf"
),
#
# Test if send a zipfile returns a document correctly
# Test if send a zipfile returns a document correctly
#
(join('data', 'test.zip'), "zip", "txt", "application/zip", True),
(
join
(
'data'
,
'test.zip'
),
"zip"
,
"txt"
,
"application/zip"
,
True
),
#
# Convert compressed html to txt
# Convert compressed html to txt
#
(join('data', 'test.zip'), "zip", "txt", "text/plain"),
(
join
(
'data'
,
'test.zip'
),
"zip"
,
"txt"
,
"text/plain"
),
#
# Test export pptx to odp
# Test export pptx to odp
#
(join('data', 'test.pptx'), "pptx", "odp", "application/vnd.oasis."+
(
join
(
'data'
,
'test.pptx'
),
"pptx"
,
"odp"
,
"application/vnd.oasis."
+
#
"opendocument.presentation"),
"opendocument.presentation"
),
#
]
]
#
def testConvert(self):
def
testConvert
(
self
):
#
"""Convert OOofiles"""
"""Convert OOofiles"""
#
self.runConversionList(self.ConversionScenarioList())
self
.
runConversionList
(
self
.
ConversionScenarioList
())
#
def FaultConversionScenarioList(self):
def
FaultConversionScenarioList
(
self
):
#
return [
return
[
#
# Test to verify if server fail when a empty string is sent
# Test to verify if server fail when a empty string is sent
#
('', '', ''),
(
''
,
''
,
''
),
#
# Try convert one document for a invalid format
# Try convert one document for a invalid format
#
(open(join('data', 'test.doc')).read(), 'doc', 'xyz'),
(
open
(
join
(
'data'
,
'test.doc'
)).
read
(),
'doc'
,
'xyz'
),
#
# Try convert one document to format not possible
# Try convert one document to format not possible
#
(open(join('data', 'test.odp')).read(), 'odp', 'doc'),
(
open
(
join
(
'data'
,
'test.odp'
)).
read
(),
'odp'
,
'doc'
),
#
]
]
#
def testFaultConversion(self):
def
testFaultConversion
(
self
):
#
"""Convert Invalid OOofiles"""
"""Convert Invalid OOofiles"""
#
self.runFaultConversionList(self.FaultConversionScenarioList())
self
.
runFaultConversionList
(
self
.
FaultConversionScenarioList
())
def
GetMetadataScenarioList
(
self
):
def
GetMetadataScenarioList
(
self
):
return
[
return
[
...
@@ -80,12 +80,12 @@ class TestServer(TestCase):
...
@@ -80,12 +80,12 @@ class TestServer(TestCase):
'udooo Test'
,
Subject
=
'Subject Test'
,
Description
=
'cloudooo Comments'
,
'udooo Test'
,
Subject
=
'Subject Test'
,
Description
=
'cloudooo Comments'
,
Type
=
'Text'
,
MIMEType
=
'application/vnd.oasis.opendocument.text'
,
Type
=
'Text'
,
MIMEType
=
'application/vnd.oasis.opendocument.text'
,
ModifyDate
=
'2/8/2010 9:57:3'
,
Keywords
=
'Keywords Test'
)),
ModifyDate
=
'2/8/2010 9:57:3'
,
Keywords
=
'Keywords Test'
)),
#
# Test method getFileMetadataItemList. With data converted
# Test method getFileMetadataItemList. With data converted
#
(join('data', 'testMetadata.odt'), "odt", dict(Title='cloudooo Test',
(
join
(
'data'
,
'testMetadata.odt'
),
"odt"
,
dict
(
Title
=
'cloudooo Test'
,
#
Subject='Subject Test', Description='cloudooo Comments',
Subject
=
'Subject Test'
,
Description
=
'cloudooo Comments'
,
#
Type='Text', MIMEType='application/vnd.oasis.opendocument.text',
Type
=
'Text'
,
MIMEType
=
'application/vnd.oasis.opendocument.text'
,
#
ModifyDate='2/8/2010 9:57:3', Keywords='Keywords Test'),
ModifyDate
=
'2/8/2010 9:57:3'
,
Keywords
=
'Keywords Test'
),
#
True),
True
),
]
]
def
testGetMetadata
(
self
):
def
testGetMetadata
(
self
):
...
@@ -97,11 +97,11 @@ class TestServer(TestCase):
...
@@ -97,11 +97,11 @@ class TestServer(TestCase):
# Test server using method updateFileMetadata
# Test server using method updateFileMetadata
(
join
(
'data'
,
'testMetadata.odt'
),
"odt"
,
dict
(
Title
=
'testSetMetadata'
)),
(
join
(
'data'
,
'testMetadata.odt'
),
"odt"
,
dict
(
Title
=
'testSetMetadata'
)),
# Test server using method updateFileMetadata with unsual metadata
# Test server using method updateFileMetadata with unsual metadata
#
(join('data', 'testMetadata.odt'), "odt", dict(Reference='testSet'+
(
join
(
'data'
,
'testMetadata.odt'
),
"odt"
,
dict
(
Reference
=
'testSet'
+
#
'Metadata')),
'Metadata'
)),
#
# Test document that already has metadata. Check if the metadata is
# Test document that already has metadata. Check if the metadata is
#
# not deleted, but updated
# not deleted, but updated
#
(join('data', 'testMetadata.odt'), "odt", dict(Title='cloudooo Title')),
(
join
(
'data'
,
'testMetadata.odt'
),
"odt"
,
dict
(
Title
=
'cloudooo Title'
)),
]
]
def
testUpdateMetadata
(
self
):
def
testUpdateMetadata
(
self
):
...
...
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