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
53bb0a8d
Commit
53bb0a8d
authored
Jun 01, 2011
by
Priscila Manhaes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create method for testing scenarios of conversion that should fail
parent
28c04038
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
cloudooo/tests/cloudoooTestCase.py
cloudooo/tests/cloudoooTestCase.py
+30
-4
No files found.
cloudooo/tests/cloudoooTestCase.py
View file @
53bb0a8d
...
@@ -2,7 +2,7 @@ import unittest
...
@@ -2,7 +2,7 @@ import unittest
import
sys
import
sys
from
os
import
environ
from
os
import
environ
from
ConfigParser
import
ConfigParser
from
ConfigParser
import
ConfigParser
from
xmlrpclib
import
ServerProxy
from
xmlrpclib
import
ServerProxy
,
Fault
from
magic
import
Magic
from
magic
import
Magic
from
base64
import
encodestring
,
decodestring
from
base64
import
encodestring
,
decodestring
...
@@ -42,6 +42,12 @@ class TestCase(unittest.TestCase):
...
@@ -42,6 +42,12 @@ class TestCase(unittest.TestCase):
file_type
=
self
.
_getFileType
(
output_data
)
file_type
=
self
.
_getFileType
(
output_data
)
self
.
assertEquals
(
file_type
,
destination_mimetype
)
self
.
assertEquals
(
file_type
,
destination_mimetype
)
def
_testFaultConversion
(
self
,
data
,
source_format
,
destination_format
):
""" Generic test for fail converting"""
self
.
assertRaises
(
Fault
,
self
.
proxy
.
convertFile
,
(
data
,
source_format
,
destination_format
))
def
_testGetMetadata
(
self
,
input_url
,
source_format
,
expected_metadata
,
def
_testGetMetadata
(
self
,
input_url
,
source_format
,
expected_metadata
,
base_document
=
False
):
base_document
=
False
):
""" Generic tes for getting metadata file"""
""" Generic tes for getting metadata file"""
...
@@ -64,7 +70,10 @@ class TestCase(unittest.TestCase):
...
@@ -64,7 +70,10 @@ class TestCase(unittest.TestCase):
self
.
assertEquals
(
new_metadata_dict
[
key
],
value
)
self
.
assertEquals
(
new_metadata_dict
[
key
],
value
)
def
ConversionScenarioList
(
self
):
def
ConversionScenarioList
(
self
):
"""This method must be overwrited into subclasses"""
"""
Method used to convert files
must be overwrited into subclasses
"""
return
[]
return
[]
def
runConversionList
(
self
,
scenarios
):
def
runConversionList
(
self
,
scenarios
):
...
@@ -72,7 +81,10 @@ class TestCase(unittest.TestCase):
...
@@ -72,7 +81,10 @@ class TestCase(unittest.TestCase):
self
.
_testConvertFile
(
*
scenario
)
self
.
_testConvertFile
(
*
scenario
)
def
GetMetadataScenarioList
(
self
):
def
GetMetadataScenarioList
(
self
):
"""This method must be overwrited into subclasses"""
"""
Method used to getMetadata from file
must be overwrited into subclasses
"""
return
[]
return
[]
def
runGetMetadataList
(
self
,
scenarios
):
def
runGetMetadataList
(
self
,
scenarios
):
...
@@ -80,10 +92,24 @@ class TestCase(unittest.TestCase):
...
@@ -80,10 +92,24 @@ class TestCase(unittest.TestCase):
self
.
_testGetMetadata
(
*
scenario
)
self
.
_testGetMetadata
(
*
scenario
)
def
UpdateMetadataScenarioList
(
self
):
def
UpdateMetadataScenarioList
(
self
):
"""This method must be overwrited into subclasses"""
"""
Method used to set/updateMetadata from file
must be overwrited into subclasses
"""
return
[]
return
[]
def
runUpdateMetadataList
(
self
,
scenarios
):
def
runUpdateMetadataList
(
self
,
scenarios
):
for
scenario
in
scenarios
:
for
scenario
in
scenarios
:
self
.
_testUpdateMetadata
(
*
scenario
)
self
.
_testUpdateMetadata
(
*
scenario
)
def
FaultConversionScenarioList
(
self
):
"""
Method used to verify fault scenarios
must be overwrited into subclasses
"""
return
[]
def
runFaultConversionList
(
self
,
scenarios
):
for
scenario
in
scenarios
:
self
.
_testFaultConversion
(
*
scenario
)
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