robotframework-doctestlibrary 0.23.0.dev1__py3-none-any.whl → 0.23.0.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- DocTest/CompareImage.py +11 -10
- DocTest/VisualTest.py +6 -7
- {robotframework_doctestlibrary-0.23.0.dev1.dist-info → robotframework_doctestlibrary-0.23.0.dev2.dist-info}/METADATA +1 -1
- {robotframework_doctestlibrary-0.23.0.dev1.dist-info → robotframework_doctestlibrary-0.23.0.dev2.dist-info}/RECORD +6 -6
- {robotframework_doctestlibrary-0.23.0.dev1.dist-info → robotframework_doctestlibrary-0.23.0.dev2.dist-info}/LICENSE +0 -0
- {robotframework_doctestlibrary-0.23.0.dev1.dist-info → robotframework_doctestlibrary-0.23.0.dev2.dist-info}/WHEEL +0 -0
DocTest/CompareImage.py
CHANGED
|
@@ -445,16 +445,17 @@ class CompareImage(object):
|
|
|
445
445
|
if placeholders is None:
|
|
446
446
|
placeholders = self.placeholders
|
|
447
447
|
images_with_placeholders = self.opencv_images
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
if
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
448
|
+
if resize or blur:
|
|
449
|
+
for i in range(len(images_with_placeholders)):
|
|
450
|
+
if resize:
|
|
451
|
+
if dimensions is None:
|
|
452
|
+
raise AssertionError("Dimensions must be defined for resizing")
|
|
453
|
+
images_with_placeholders[i] = cv2.resize(images_with_placeholders[i], dimensions[i])
|
|
454
|
+
if blur:
|
|
455
|
+
kernel_size = int(images_with_placeholders[i].shape[1]/50)
|
|
456
|
+
# must be odd if median
|
|
457
|
+
kernel_size += kernel_size%2-1
|
|
458
|
+
images_with_placeholders[i] = cv2.GaussianBlur(images_with_placeholders[i], (kernel_size, kernel_size), 1.5)
|
|
458
459
|
for placeholder in placeholders:
|
|
459
460
|
if placeholder['page'] == 'all':
|
|
460
461
|
for i in range(len(images_with_placeholders)):
|
DocTest/VisualTest.py
CHANGED
|
@@ -189,12 +189,9 @@ class VisualTest(object):
|
|
|
189
189
|
tic = time.perf_counter()
|
|
190
190
|
if reference_compare_image.placeholders != []:
|
|
191
191
|
candidate_compare_image.placeholders = reference_compare_image.placeholders
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
else:
|
|
196
|
-
reference_collection = reference_compare_image.opencv_images
|
|
197
|
-
compare_collection = candidate_compare_image.opencv_images
|
|
192
|
+
reference_collection = reference_compare_image.get_image_with_placeholders(blur=blur)
|
|
193
|
+
compare_collection = candidate_compare_image.get_image_with_placeholders(resize=resize_candidate, dimensions=reference_image_dimensions, blur=blur)
|
|
194
|
+
logging.debug("OCR Data: {}".format(reference_compare_image.text_content))
|
|
198
195
|
|
|
199
196
|
if len(reference_collection) != len(compare_collection):
|
|
200
197
|
print("Pages in reference file:{}. Pages in candidate file:{}".format(
|
|
@@ -479,7 +476,9 @@ class VisualTest(object):
|
|
|
479
476
|
grayB = cv2.cvtColor(candidate, cv2.COLOR_BGR2GRAY)
|
|
480
477
|
|
|
481
478
|
# Blur is now in get_images_with_placeholders
|
|
482
|
-
#
|
|
479
|
+
# This is now a double blur, which is not necessary
|
|
480
|
+
# ToDo: Think about a better solution of blurring
|
|
481
|
+
# Blur images if blur=True
|
|
483
482
|
# if compare_options['blur']:
|
|
484
483
|
# kernel_size = int(grayA.shape[1]/50)
|
|
485
484
|
# # must be odd if median
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
DocTest/__init__.py,sha256=7i6KhOs4WYLHQAOhem84gdg7vDK1TncVugnHZkvoA9w,13105
|
|
2
|
-
DocTest/CompareImage.py,sha256=
|
|
2
|
+
DocTest/CompareImage.py,sha256=gclvHLfaee5Cdwk9gjqUoeKcQ1B4QFL0nJAt4dr-pyo,32761
|
|
3
3
|
DocTest/Downloader.py,sha256=97y361WOQ2bn1vXsMcqLPXj_FFKmhQz3FkR9FSRThAo,1462
|
|
4
4
|
DocTest/Ocr.py,sha256=TKdH_r0M4XXPwMIcmgSQfnozcXw-iFVontGCzAayMag,8235
|
|
5
5
|
DocTest/PdfTest.py,sha256=u8EEu0zgiNy_TE0P26zCzgUbUYSO2WyF5SwhQikhF4c,12592
|
|
6
6
|
DocTest/PrintJob.py,sha256=Vl9JZMjku1z2OMAqnzVhlCsKusKJr1HQpz8YAXLgPeY,147
|
|
7
7
|
DocTest/PrintJobTests.py,sha256=w77y21c-CajSRSkKrx2PQwt7xYEwAxeKxq090OxmNDg,19270
|
|
8
|
-
DocTest/VisualTest.py,sha256=
|
|
9
|
-
robotframework_doctestlibrary-0.23.0.
|
|
10
|
-
robotframework_doctestlibrary-0.23.0.
|
|
11
|
-
robotframework_doctestlibrary-0.23.0.
|
|
12
|
-
robotframework_doctestlibrary-0.23.0.
|
|
8
|
+
DocTest/VisualTest.py,sha256=5EBupb3fH5Hc85mBFO4ADyLmKFGWTxrV5Xw0d8nQ3Is,62646
|
|
9
|
+
robotframework_doctestlibrary-0.23.0.dev2.dist-info/LICENSE,sha256=1-hnhyZ0wFfHRVpZUuyrqu75iBVVe8--GD-V5898FIU,10443
|
|
10
|
+
robotframework_doctestlibrary-0.23.0.dev2.dist-info/METADATA,sha256=xfkftUAnHM-T3T_1kKnhMATLHTQkAymu7NErwZgekJ0,14381
|
|
11
|
+
robotframework_doctestlibrary-0.23.0.dev2.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
|
|
12
|
+
robotframework_doctestlibrary-0.23.0.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|