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
21af5fd2
Commit
21af5fd2
authored
Dec 09, 2016
by
Tristan Cavelier
Committed by
Cédric Le Ninivin
Dec 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add handler tests for getAllowedConversionFormat
parent
4b1f48f8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
597 additions
and
0 deletions
+597
-0
cloudooo/handler/ooo/tests/testOooHandler.py
cloudooo/handler/ooo/tests/testOooHandler.py
+554
-0
cloudooo/handler/pdf/tests/testPdfHandler.py
cloudooo/handler/pdf/tests/testPdfHandler.py
+13
-0
cloudooo/handler/wkhtmltopdf/tests/testWkhtmltopdfHandler.py
cloudooo/handler/wkhtmltopdf/tests/testWkhtmltopdfHandler.py
+12
-0
cloudooo/handler/x2t/tests/testX2tHandler.py
cloudooo/handler/x2t/tests/testX2tHandler.py
+18
-0
No files found.
cloudooo/handler/ooo/tests/testOooHandler.py
View file @
21af5fd2
This diff is collapsed.
Click to expand it.
cloudooo/handler/pdf/tests/testPdfHandler.py
View file @
21af5fd2
...
...
@@ -64,6 +64,19 @@ class TestHandler(HandlerTestCase):
self
.
assertEquals
(
metadata
[
"title"
],
'Set Metadata Test'
)
self
.
assertEquals
(
metadata
[
'creator'
],
'gabriel
\
'
@'
)
def
testGetAllowedConversionFormatList
(
self
):
"""Test all combination of mimetype
None of the types below define any mimetype parameter to not ignore so far.
"""
get
=
Handler
.
getAllowedConversionFormatList
# Handled mimetypes
self
.
assertEquals
(
get
(
"application/pdf;ignored=param"
),
[(
"text/plain"
,
"Plain Text"
)])
# Unhandled mimetypes
self
.
assertEquals
(
get
(
"text/plain;ignored=param"
),
[])
self
.
assertEquals
(
get
(
"text/plain;charset=UTF-8;ignored=param"
),
[])
def
test_suite
():
return
make_suite
(
TestHandler
)
cloudooo/handler/wkhtmltopdf/tests/testWkhtmltopdfHandler.py
View file @
21af5fd2
...
...
@@ -77,6 +77,18 @@ class TestHandler(HandlerTestCase):
handler
=
Handler
(
self
.
tmp_url
,
""
,
"png"
,
**
self
.
kw
)
self
.
assertRaises
(
NotImplementedError
,
handler
.
setMetadata
)
def
testGetAllowedConversionFormatList
(
self
):
"""Test all combination of mimetype
None of the types below define any mimetype parameter to not ignore so far.
"""
get
=
Handler
.
getAllowedConversionFormatList
# Handled mimetypes
self
.
assertEquals
(
get
(
"text/html;ignored=param"
),
[(
"application/pdf"
,
"PDF - Portable Document Format"
)])
# Unhandled mimetypes
self
.
assertEquals
(
get
(
"application/pdf;ignored=param"
),
[])
def
test_suite
():
return
make_suite
(
TestHandler
)
cloudooo/handler/x2t/tests/testX2tHandler.py
View file @
21af5fd2
...
...
@@ -91,6 +91,24 @@ class TestHandler(HandlerTestCase):
handler
=
Handler
(
self
.
tmp_url
,
""
,
"xlsy"
,
**
self
.
kw
)
self
.
assertRaises
(
NotImplementedError
,
handler
.
setMetadata
)
def
testGetAllowedConversionFormatList
(
self
):
"""Test all combination of mimetype
None of the types below define any mimetype parameter to not ignore so far.
"""
get
=
Handler
.
getAllowedConversionFormatList
self
.
assertEquals
(
get
(
"application/x-asc-text;ignored=param"
),
[(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
,
"Word 2007 Document"
)])
self
.
assertEquals
(
get
(
"application/x-asc-spreadsheet;ignored=param"
),
[(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
,
"Excel 2007 Spreadsheet"
)])
self
.
assertEquals
(
get
(
"application/x-asc-presentation;ignored=param"
),
[(
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
,
"PowerPoint 2007 Presentation"
)])
self
.
assertEquals
(
get
(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document;ignored=param"
),
[(
"application/x-asc-text"
,
"OnlyOffice Text Document"
)])
self
.
assertEquals
(
get
(
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;ignored=param"
),
[(
"application/x-asc-spreadsheet"
,
"OnlyOffice Spreadsheet"
)])
self
.
assertEquals
(
get
(
"application/vnd.openxmlformats-officedocument.presentationml.presentation;ignored=param"
),
[(
"application/x-asc-presentation"
,
"OnlyOffice Presentation"
)])
def
test_suite
():
return
make_suite
(
TestHandler
)
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