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
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
francois
erp5
Commits
b08ca5f1
Commit
b08ca5f1
authored
May 06, 2012
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be more tolerant with the Image comparations.
parent
3b22ae1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
product/ERP5/tests/testERP5WebWithDms.py
product/ERP5/tests/testERP5WebWithDms.py
+8
-4
No files found.
product/ERP5/tests/testERP5WebWithDms.py
View file @
b08ca5f1
...
@@ -49,6 +49,8 @@ except ImportError:
...
@@ -49,6 +49,8 @@ except ImportError:
import
Image
import
Image
LANGUAGE_LIST
=
(
'en'
,
'fr'
,
'de'
,
'bg'
,)
LANGUAGE_LIST
=
(
'en'
,
'fr'
,
'de'
,
'bg'
,)
IMAGE_COMPARE_TOLERANCE
=
800
def
makeFilePath
(
name
):
def
makeFilePath
(
name
):
return
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_data'
,
name
)
return
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_data'
,
name
)
...
@@ -805,9 +807,10 @@ return True
...
@@ -805,9 +807,10 @@ return True
# Compare images and accept some minimal difference,
# Compare images and accept some minimal difference,
difference_value
=
compare_image
(
StringIO
(
converted_data
),
expected_image
)
difference_value
=
compare_image
(
StringIO
(
converted_data
),
expected_image
)
self
.
assertTrue
(
difference_value
<
100
,
self
.
assertTrue
(
difference_value
<
IMAGE_COMPARE_TOLERANCE
,
"Conversion from svg to png create one too small image, "
+
\
"Conversion from svg to png create one too small image, "
+
\
"so it failed to download the image. (%s >= 100)"
%
difference_value
)
"so it failed to download the image. (%s >= %s)"
%
(
difference_value
,
IMAGE_COMPARE_TOLERANCE
))
def
_testImageConversionFromSVGToPNG_url
(
self
,
image_url
,
portal_type
=
"Image"
):
def
_testImageConversionFromSVGToPNG_url
(
self
,
image_url
,
portal_type
=
"Image"
):
""" Test Convert one SVG Image with an image url. ie:
""" Test Convert one SVG Image with an image url. ie:
...
@@ -835,9 +838,10 @@ return True
...
@@ -835,9 +838,10 @@ return True
# Compare images and accept some minimal difference,
# Compare images and accept some minimal difference,
difference_value
=
compare_image
(
StringIO
(
converted_data
),
expected_image
)
difference_value
=
compare_image
(
StringIO
(
converted_data
),
expected_image
)
self
.
assertTrue
(
difference_value
<
100
,
self
.
assertTrue
(
difference_value
<
IMAGE_COMPARE_TOLERANCE
,
"Conversion from svg to png create one too small image, "
+
\
"Conversion from svg to png create one too small image, "
+
\
"so it failed to download the image. (%s >= 100)"
%
difference_value
)
"so it failed to download the image. (%s >= %s)"
%
(
difference_value
,
IMAGE_COMPARE_TOLERANCE
))
def
_testImageConversionFromSVGToPNG_file_url
(
self
,
portal_type
=
"Image"
):
def
_testImageConversionFromSVGToPNG_file_url
(
self
,
portal_type
=
"Image"
):
""" Test Convert one SVG Image with an image using local path (file)
""" Test Convert one SVG Image with an image using local path (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