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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
cloudooo
Commits
e0af811a
Commit
e0af811a
authored
Dec 21, 2016
by
Tristan Cavelier
Committed by
Cédric Le Ninivin
Dec 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testOooServer update test to be a bit more flexible
parent
21af5fd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
cloudooo/handler/ooo/tests/testOooServer.py
cloudooo/handler/ooo/tests/testOooServer.py
+9
-16
No files found.
cloudooo/handler/ooo/tests/testOooServer.py
View file @
e0af811a
...
@@ -66,20 +66,18 @@ class TestServer(TestCase):
...
@@ -66,20 +66,18 @@ class TestServer(TestCase):
"""Verify if getAllowedExtensionList returns is a list with extension and
"""Verify if getAllowedExtensionList returns is a list with extension and
ui_name. The request is by extension"""
ui_name. The request is by extension"""
doc_allowed_list
=
self
.
proxy
.
getAllowedExtensionList
({
'extension'
:
"doc"
})
doc_allowed_list
=
self
.
proxy
.
getAllowedExtensionList
({
'extension'
:
"doc"
})
doc_allowed_list
.
sort
()
# Verify all expected types ("doc" MAY NOT be present)
for
arg
in
doc_allowed_list
:
self
.
assertEquals
(
sorted
([(
a
,
b
)
for
a
,
b
in
doc_allowed_list
if
a
!=
"doc"
]),
self
.
assertTrue
(
tuple
(
arg
)
in
text_expected_tuple
,
sorted
(
list
(
filter
(
lambda
(
a
,
b
):
a
!=
"doc"
,
text_expected_tuple
))))
"%s not in %s"
%
(
arg
,
text_expected_tuple
))
def
testGetAllowedExtensionListByMimetype
(
self
):
def
testGetAllowedExtensionListByMimetype
(
self
):
"""Verify if getAllowedExtensionList returns is a list with extension and
"""Verify if getAllowedExtensionList returns is a list with extension and
ui_name. The request is by mimetype"""
ui_name. The request is by mimetype"""
request_dict
=
{
"mimetype"
:
"application/msword"
}
request_dict
=
{
"mimetype"
:
"application/msword"
}
msword_allowed_list
=
self
.
proxy
.
getAllowedExtensionList
(
request_dict
)
msword_allowed_list
=
self
.
proxy
.
getAllowedExtensionList
(
request_dict
)
msword_allowed_list
.
sort
()
# Verify all expected types ("doc" MAY NOT be present)
for
arg
in
msword_allowed_list
:
self
.
assertEquals
(
sorted
([(
a
,
b
)
for
a
,
b
in
msword_allowed_list
if
a
!=
"doc"
]),
self
.
assertTrue
(
tuple
(
arg
)
in
text_expected_tuple
,
sorted
(
list
(
filter
(
lambda
(
a
,
b
):
a
!=
"doc"
,
text_expected_tuple
))))
"%s not in %s"
%
(
arg
,
text_expected_tuple
))
def
ConversionScenarioList
(
self
):
def
ConversionScenarioList
(
self
):
return
[
return
[
...
@@ -381,14 +379,9 @@ class TestServer(TestCase):
...
@@ -381,14 +379,9 @@ class TestServer(TestCase):
response_code
,
response_dict
,
response_message
=
\
response_code
,
response_dict
,
response_message
=
\
self
.
proxy
.
getAllowedTargetItemList
(
mimetype
)
self
.
proxy
.
getAllowedTargetItemList
(
mimetype
)
self
.
assertEquals
(
response_code
,
200
)
self
.
assertEquals
(
response_code
,
200
)
# Verify if all expected types are in response list
# Verify all expected types ("odt" MAY NOT be present)
for
arg
in
text_expected_tuple
:
self
.
assertEquals
(
sorted
([(
a
,
b
)
for
a
,
b
in
response_dict
[
'response_data'
]
if
a
!=
"odt"
]),
self
.
assertTrue
(
list
(
arg
)
in
response_dict
[
'response_data'
],
sorted
(
list
(
filter
(
lambda
(
a
,
b
):
a
!=
"odt"
,
text_expected_tuple
))))
"%s not in %s"
%
(
arg
,
response_dict
[
'response_data'
]))
# Verify if all types in response list are expected
for
arg
in
response_dict
[
'response_data'
]:
self
.
assertTrue
(
tuple
(
arg
)
in
text_expected_tuple
,
"%s not in %s"
%
(
arg
,
text_expected_tuple
))
def
testGetTableItemListFromOdt
(
self
):
def
testGetTableItemListFromOdt
(
self
):
"""Test if getTableItemList can get the table item list from odt file"""
"""Test if getTableItemList can get the table item list from odt file"""
...
...
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