From a62867b96050d95c8246a56e2ad2505a342abab2 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Wed, 20 Sep 2023 23:44:40 +0300 Subject: [PATCH] #1282 Add file to logs --- api/tests/integration/common/rendering/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/tests/integration/common/rendering/__init__.py b/api/tests/integration/common/rendering/__init__.py index 5b80150aea..fd81646747 100644 --- a/api/tests/integration/common/rendering/__init__.py +++ b/api/tests/integration/common/rendering/__init__.py @@ -1,6 +1,7 @@ import os import platform import sys +import base64 from env_indigo import getPlatform, isIronPython, isJython @@ -204,14 +205,17 @@ def checkBitmapSimilarity(filename, ref_filename): return "%s rendering status: Problem: %s" % (filename, str(e)) channels = ["red", "green", "blue", "alpha"] + with open("%s/out/%s" % (dirname, filename), "rb") as file: + binary_data = file.read() for i, result in enumerate(results): if result > (HASH_SIZE**2) * 0.1: return ( - "%s rendering status: Problem: PNG similarity is %s for %s channel" + "%s rendering status: Problem: PNG similarity is %s for %s channel\n%s\n" % ( filename, round(1 - (result / float(HASH_SIZE**2)), 2), channels[i], + base64.b64encode(binary_data), ) )