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
Vincent Bechu
cloudooo
Commits
3aecbb02
Commit
3aecbb02
authored
Jun 07, 2011
by
Priscila Manhaes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor to verify files that does not informe destination mimetype and to message in case of error
parent
e24cd9e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
cloudooo/tests/cloudoooTestCase.py
cloudooo/tests/cloudoooTestCase.py
+18
-6
No files found.
cloudooo/tests/cloudoooTestCase.py
View file @
3aecbb02
...
...
@@ -43,12 +43,24 @@ class TestCase(unittest.TestCase):
def
_testConvertFile
(
self
,
input_url
,
source_format
,
destination_format
,
destination_mimetype
,
zip
=
False
):
""" Generic test for converting file """
output_data
=
self
.
proxy
.
convertFile
(
encodestring
(
open
(
input_url
).
read
()),
source_format
,
destination_format
,
zip
)
file_type
=
self
.
_getFileType
(
output_data
)
self
.
assertEquals
(
file_type
,
destination_mimetype
)
fault_list
=
[]
try
:
output_data
=
self
.
proxy
.
convertFile
(
encodestring
(
open
(
input_url
).
read
()),
source_format
,
destination_format
,
zip
)
file_type
=
self
.
_getFileType
(
output_data
)
if
destination_mimetype
!=
None
:
self
.
assertEquals
(
file_type
,
destination_mimetype
)
else
:
if
file_type
.
endswith
(
": empty"
):
fault_list
.
append
((
source_format
,
destination_format
,
file_type
))
except
Fault
,
err
:
fault_list
.
append
((
source_format
,
destination_format
,
err
.
faultString
))
if
fault_list
:
template_message
=
'input_format: %r
\
n
output_format: %r
\
n
traceback:
\
n
%s'
message
=
'
\
n
'
.
join
([
template_message
%
fault
for
fault
in
fault_list
])
self
.
fail
(
'Failed Conversions:
\
n
'
+
message
)
def
_testFaultConversion
(
self
,
data
,
source_format
,
destination_format
):
""" Generic test for fail converting"""
...
...
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