Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
Roque
erp5
Commits
7089f235
Commit
7089f235
authored
Apr 03, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a test for resizing a monochrome tiff image.
parent
033e6d63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
product/ERP5OOo/tests/testDms.py
product/ERP5OOo/tests/testDms.py
+10
-1
product/ERP5OOo/tests/test_document/monochrome_sample.tiff
product/ERP5OOo/tests/test_document/monochrome_sample.tiff
+0
-0
No files found.
product/ERP5OOo/tests/testDms.py
View file @
7089f235
...
...
@@ -48,6 +48,7 @@
import
unittest
import
time
import
StringIO
from
subprocess
import
Popen
,
PIPE
from
cgi
import
FieldStorage
import
ZPublisher.HTTPRequest
...
...
@@ -265,7 +266,6 @@ class TestDocument(TestDocumentMixin):
image
=
Image
.
open
(
filename
)
image_size
=
image
.
size
except
ImportError
:
from
subprocess
import
Popen
,
PIPE
identify_output
=
Popen
([
'identify'
,
filename
],
stdout
=
PIPE
).
communicate
()[
0
]
image_size
=
tuple
(
map
(
lambda
x
:
int
(
x
),
...
...
@@ -1344,6 +1344,15 @@ class TestDocument(TestDocumentMixin):
self
.
assertEquals
(
'Image'
,
document
.
getPortalType
())
self
.
assertEquals
(
'ERP5 is a free software
\
n
\
n
'
,
document
.
asText
())
def
test_MonochromeImageResize
(
self
):
upload_file
=
makeFileUpload
(
'monochrome_sample.tiff'
)
document
=
self
.
portal
.
portal_contributions
.
newContent
(
file
=
upload_file
)
self
.
assertEquals
(
'Image'
,
document
.
getPortalType
())
resized_image
=
document
.
convert
(
format
=
'png'
,
display
=
'small'
)[
1
]
identify_output
=
Popen
([
'identify'
,
'-verbose'
,
'-'
],
stdin
=
PIPE
,
stdout
=
PIPE
).
communicate
(
resized_image
)[
0
]
self
.
assertFalse
(
'1-bit'
in
identify_output
)
self
.
assertEquals
(
'ERP5 is a free software
\
n
\
n
'
,
document
.
asText
())
def
test_Base_showFoundText
(
self
):
# Create document with good content
document
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'Drawing'
)
...
...
product/ERP5OOo/tests/test_document/monochrome_sample.tiff
0 → 100644
View file @
7089f235
718 Bytes
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