Skip to content

Commit 902dfb8

Browse files
committedJan 10, 2018
Disable diff image encoded output
1 parent 0c93eab commit 902dfb8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎tests/src/python/test_qgsserver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
"""QGIS Unit tests for QgsServer.
33
4-
Set the env var NO_ENCODED_OUTPUT to disable printing the base64 encoded image diff
4+
Set the env var ENCODED_OUTPUT to enable printing the base64 encoded image diff
55
66
FIXME: keep here only generic server tests and move specific services
77
tests to test_qgsserver_<service>.py
@@ -191,7 +191,7 @@ def _img_diff_error(self, response, headers, image, max_diff=100, max_size_diff=
191191

192192
with open(os.path.join(tempfile.gettempdir(), image + "_result.png"), "rb") as rendered_file:
193193
encoded_rendered_file = base64.b64encode(rendered_file.read())
194-
if os.environ.get('NO_ENCODED_OUTPUT'):
194+
if not os.environ.get('ENCODED_OUTPUT'):
195195
message = "Image is wrong\: rendered file %s/%s_result.png" % (tempfile.gettempdir(), image)
196196
else:
197197
message = "Image is wrong\n%s\nImage:\necho '%s' | base64 -d >%s/%s_result.png" % (
@@ -201,7 +201,7 @@ def _img_diff_error(self, response, headers, image, max_diff=100, max_size_diff=
201201
# If the failure is in image sizes the diff file will not exists.
202202
if os.path.exists(os.path.join(tempfile.gettempdir(), image + "_result_diff.png")):
203203
with open(os.path.join(tempfile.gettempdir(), image + "_result_diff.png"), "rb") as diff_file:
204-
if os.environ.get('NO_ENCODED_OUTPUT'):
204+
if not os.environ.get('ENCODED_OUTPUT'):
205205
message = "Image is wrong\: diff file %s/%s_result_diff.png" % (tempfile.gettempdir(), image)
206206
else:
207207
encoded_diff_file = base64.b64encode(diff_file.read())

0 commit comments

Comments
 (0)