Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
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
Kirill Smelkov
cloudooo
Commits
a1b6192c
Commit
a1b6192c
authored
Sep 23, 2011
by
Priscila Manhaes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added failure tests for corrupt files
parent
abeb2a8c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
0 deletions
+74
-0
cloudooo/handler/ffmpeg/tests/testFfmpegServer.py
cloudooo/handler/ffmpeg/tests/testFfmpegServer.py
+25
-0
cloudooo/handler/imagemagick/tests/testImagemagickServer.py
cloudooo/handler/imagemagick/tests/testImagemagickServer.py
+24
-0
cloudooo/handler/pdf/tests/testPdfServer.py
cloudooo/handler/pdf/tests/testPdfServer.py
+25
-0
No files found.
cloudooo/handler/ffmpeg/tests/testFfmpegServer.py
View file @
a1b6192c
...
...
@@ -41,6 +41,20 @@ class TestServer(TestCase):
"""Converts ogv video to mpeg format"""
self
.
runConversionList
(
self
.
ConversionScenarioList
())
def
FaultConversionScenarioList
(
self
):
return
[
# Test to verify if server fail when a empty string is sent
(
''
,
''
,
''
),
# Try convert one video for a invalid format
(
open
(
join
(
'data'
,
'test.ogv'
)).
read
(),
'ogv'
,
'xyz'
),
# Try convert one video to format not possible
(
open
(
join
(
'data'
,
'test.ogv'
)).
read
(),
'ogv'
,
'moov'
),
]
def
testFaultConversion
(
self
):
"""Test fail convertion of Invalid video files"""
self
.
runFaultConversionList
(
self
.
FaultConversionScenarioList
())
def
GetMetadataScenarioList
(
self
):
return
[
(
join
(
'data'
,
'test.ogv'
),
"ogv"
,
dict
(
Data
=
''
,
Encoder
=
'Lavf52.64'
+
...
...
@@ -51,6 +65,17 @@ class TestServer(TestCase):
"""test if metadata are extracted correctly"""
self
.
runGetMetadataList
(
self
.
GetMetadataScenarioList
())
def
FaultGetMetadataScenarioList
(
self
):
return
[
# Test to verify if server fail when a empty string is sent
(
''
,
''
),
]
def
testFaultGetMetadata
(
self
):
"""Test getMetadata from invalid video files"""
self
.
runFaultGetMetadataList
(
self
.
FaultGetMetadataScenarioList
())
def
UpdateMetadataScenarioList
(
self
):
return
[
(
join
(
'data'
,
'test.ogv'
),
"ogv"
,
dict
(
Title
=
'Server Set Metadata '
+
...
...
cloudooo/handler/imagemagick/tests/testImagemagickServer.py
View file @
a1b6192c
...
...
@@ -41,6 +41,19 @@ class TestServer(TestCase):
"""Converts png to jpg"""
self
.
runConversionList
(
self
.
ConversionScenarioList
())
def
FaultConversionScenarioList
(
self
):
return
[
# Test to verify if server fail when a empty string is sent
(
''
,
''
,
''
),
# Try convert one video for a invalid format
(
open
(
join
(
'data'
,
'test.png'
)).
read
(),
'png'
,
'xyz'
),
# Try convert one video to format not possible
(
open
(
join
(
'data'
,
'test.png'
)).
read
(),
'png'
,
'8bim'
),
]
def
testFaultConversion
(
self
):
"""Test fail convertion of Invalid image files"""
def
GetMetadataScenarioList
(
self
):
return
[
(
join
(
'data'
,
'test.png'
),
"png"
,
dict
(
Compression
=
'Zip'
)),
...
...
@@ -50,5 +63,16 @@ class TestServer(TestCase):
"""test if metadata are extracted correctly"""
self
.
runGetMetadataList
(
self
.
GetMetadataScenarioList
())
def
FaultGetMetadataScenarioList
(
self
):
return
[
# Test to verify if server fail when a empty string is sent
(
''
,
''
),
]
def
testFaultGetMetadata
(
self
):
"""Test getMetadata from invalid image file"""
self
.
runFaultGetMetadataList
(
self
.
FaultGetMetadataScenarioList
())
def
test_suite
():
return
make_suite
(
TestServer
)
cloudooo/handler/pdf/tests/testPdfServer.py
View file @
a1b6192c
...
...
@@ -42,6 +42,21 @@ class TestServer(TestCase):
"""Converts pdf to txt"""
self
.
runConversionList
(
self
.
ConversionScenarioList
())
def
FaultConversionScenarioList
(
self
):
return
[
# Test to verify if server fail when a empty string is sent
(
''
,
''
,
''
),
# Try convert one video for a invalid format
(
open
(
join
(
'data'
,
'test.pdf'
)).
read
(),
'pdf'
,
'xyz'
),
# Try convert one video to format not possible
(
open
(
join
(
'data'
,
'test.pdf'
)).
read
(),
'pdf'
,
'ogv'
),
]
def
testFaultConversion
(
self
):
"""Test fail convertion of Invalid pdf files"""
self
.
runFaultConversionList
(
self
.
FaultConversionScenarioList
())
def
GetMetadataScenarioList
(
self
):
return
[
(
join
(
'data'
,
'test.pdf'
),
"pdf"
,
dict
(
title
=
'Free Cloud Alliance'
+
...
...
@@ -52,6 +67,16 @@ class TestServer(TestCase):
"""test if metadata are extracted correctly"""
self
.
runGetMetadataList
(
self
.
GetMetadataScenarioList
())
def
FaultGetMetadataScenarioList
(
self
):
return
[
# Test to verify if server fail when a empty string is sent
(
''
,
''
),
]
def
testFaultGetMetadata
(
self
):
"""Test getMetadata from invalid pdf file"""
self
.
runFaultGetMetadataList
(
self
.
FaultGetMetadataScenarioList
())
def
UpdateMetadataScenarioList
(
self
):
return
[
(
join
(
'data'
,
'test.pdf'
),
"pdf"
,
dict
(
producer
=
'Cloudooo'
)),
...
...
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