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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
cloudooo
Commits
177b7c13
Commit
177b7c13
authored
May 30, 2011
by
Priscila Manhaes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified some names
parent
7f93b479
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
cloudooo/tests/cloudoooTestCase.py
cloudooo/tests/cloudoooTestCase.py
+11
-8
No files found.
cloudooo/tests/cloudoooTestCase.py
View file @
177b7c13
...
@@ -23,6 +23,7 @@ class TestCase(unittest.TestCase):
...
@@ -23,6 +23,7 @@ class TestCase(unittest.TestCase):
config
.
read
(
server_cloudooo_conf
)
config
.
read
(
server_cloudooo_conf
)
self
.
hostname
=
config
.
get
(
"server:main"
,
"host"
)
self
.
hostname
=
config
.
get
(
"server:main"
,
"host"
)
self
.
port
=
config
.
get
(
"server:main"
,
"port"
)
self
.
port
=
config
.
get
(
"server:main"
,
"port"
)
self
.
env_path
=
config
.
get
(
"app:main"
,
"env-path"
)
self
.
proxy
=
ServerProxy
((
"http://%s:%s/RPC2"
%
(
self
.
hostname
,
self
.
port
)),
\
self
.
proxy
=
ServerProxy
((
"http://%s:%s/RPC2"
%
(
self
.
hostname
,
self
.
port
)),
\
allow_none
=
True
)
allow_none
=
True
)
...
@@ -40,23 +41,25 @@ class TestCase(unittest.TestCase):
...
@@ -40,23 +41,25 @@ 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
_testGetMetadata
(
self
,
input_url
,
source_format
,
key
,
value
):
def
_testGetMetadata
(
self
,
input_url
,
source_format
,
expected_metadata
):
""" Generic tes for getting metadata file"""
""" Generic tes for getting metadata file"""
metadata_dict
=
self
.
proxy
.
getFileMetadataItemList
(
metadata_dict
=
self
.
proxy
.
getFileMetadataItemList
(
encodestring
(
open
(
input_url
).
read
()),
encodestring
(
open
(
input_url
).
read
()),
source_format
)
source_format
)
self
.
assertEquals
(
metadata_dict
[
key
],
value
)
self
.
assertEquals
(
expected_metadata
,
metadata_dict
)
def
_testUpdateMetadata
(
self
,
input_url
,
source_format
,
metadata_dict
):
def
_testUpdateMetadata
(
self
,
input_url
,
source_format
,
metadata_dict
,
expected_metadata
):
""" Generic test for setting metadata for file """
""" Generic test for setting metadata for file """
output_data
=
self
.
proxy
.
updateFileMetadata
(
encodestring
(
open
(
input_url
).
read
()),
output_data
=
self
.
proxy
.
updateFileMetadata
(
encodestring
(
open
(
input_url
).
read
()),
source_format
,
source_format
,
metadata_dict
)
metadata_dict
)
new_metadata_dict
=
proxy
.
getFileMetadataItemList
(
new_metadata_dict
=
self
.
proxy
.
getFileMetadataItemList
(
encodestring
(
output_data
),
encodestring
(
output_data
),
source_format
)
source_format
)
self
.
assertEquals
(
new_metadata_dict
,
expected_metadata
)
def
get
ConversionScenarioList
(
self
):
def
ConversionScenarioList
(
self
):
"""This method must be overwrited into subclasses"""
"""This method must be overwrited into subclasses"""
return
[]
return
[]
...
@@ -64,7 +67,7 @@ class TestCase(unittest.TestCase):
...
@@ -64,7 +67,7 @@ class TestCase(unittest.TestCase):
for
scenario
in
scenarios
:
for
scenario
in
scenarios
:
self
.
_testConvertFile
(
*
scenario
)
self
.
_testConvertFile
(
*
scenario
)
def
get
GetMetadataScenarioList
(
self
):
def
GetMetadataScenarioList
(
self
):
"""This method must be overwrited into subclasses"""
"""This method must be overwrited into subclasses"""
return
[]
return
[]
...
@@ -72,11 +75,11 @@ class TestCase(unittest.TestCase):
...
@@ -72,11 +75,11 @@ class TestCase(unittest.TestCase):
for
scenario
in
scenarios
:
for
scenario
in
scenarios
:
self
.
_testGetMetadata
(
*
scenario
)
self
.
_testGetMetadata
(
*
scenario
)
def
get
UpdateMetadataScenarioList
(
self
):
def
UpdateMetadataScenarioList
(
self
):
"""This method must be overwrited into subclasses"""
"""This method must be overwrited into subclasses"""
return
[]
return
[]
def
run
t
UpdateMetadataList
(
self
,
scenarios
):
def
runUpdateMetadataList
(
self
,
scenarios
):
for
scenario
in
scenarios
:
for
scenario
in
scenarios
:
self
.
_testUpdateMetadata
(
*
scenario
)
self
.
_testUpdateMetadata
(
*
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