Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2172)

Unified Diff: gm/rebaseline_server/imagepairset_test.py

Issue 479613002: Add ability to output ImageBaseGSUrl to render_picture and use in rebaseline server (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix render_pictures_test after rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gm/rebaseline_server/imagepairset_test.py
diff --git a/gm/rebaseline_server/imagepairset_test.py b/gm/rebaseline_server/imagepairset_test.py
index 5e17faa2f13008b73644be22a6e783069684b337..a931e047aa22acffce6b04feea34bc939b51ad52 100755
--- a/gm/rebaseline_server/imagepairset_test.py
+++ b/gm/rebaseline_server/imagepairset_test.py
@@ -79,9 +79,12 @@ class ImagePairSetTest(unittest.TestCase):
"""Assembles some ImagePairs into an ImagePairSet, and validates results.
"""
image_pairs = [
- MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_1_AS_DICT),
- MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_2_AS_DICT),
- MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_3_AS_DICT),
+ MockImagePair(imageA_base_url=BASE_URL_1, imageB_base_url=BASE_URL_1,
+ dict_to_return=IMAGEPAIR_1_AS_DICT),
+ MockImagePair(imageA_base_url=BASE_URL_1, imageB_base_url=BASE_URL_1,
+ dict_to_return=IMAGEPAIR_2_AS_DICT),
+ MockImagePair(imageA_base_url=BASE_URL_1, imageB_base_url=BASE_URL_1,
+ dict_to_return=IMAGEPAIR_3_AS_DICT),
]
expected_imageset_dict = {
'extraColumnHeaders': {
@@ -150,12 +153,14 @@ class ImagePairSetTest(unittest.TestCase):
image_pair_set = imagepairset.ImagePairSet(
diff_base_url=DIFF_BASE_URL)
image_pair_set.add_image_pair(
- MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_1_AS_DICT))
+ MockImagePair(imageA_base_url=BASE_URL_1, imageB_base_url=BASE_URL_1,
+ dict_to_return=IMAGEPAIR_1_AS_DICT))
image_pair_set.add_image_pair(
- MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_2_AS_DICT))
+ MockImagePair(imageA_base_url=BASE_URL_1, imageB_base_url=BASE_URL_1,
+ dict_to_return=IMAGEPAIR_2_AS_DICT))
with self.assertRaises(Exception):
image_pair_set.add_image_pair(
- MockImagePair(base_url=BASE_URL_2,
+ MockImagePair(imageA_base_url=BASE_URL_2, imageB_base_url=BASE_URL_2,
dict_to_return=IMAGEPAIR_3_AS_DICT))
def test_missing_column_ids(self):
@@ -164,9 +169,11 @@ class ImagePairSetTest(unittest.TestCase):
image_pair_set = imagepairset.ImagePairSet(
diff_base_url=DIFF_BASE_URL)
image_pair_set.add_image_pair(
- MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_1_AS_DICT))
+ MockImagePair(imageA_base_url=BASE_URL_1, imageB_base_url=BASE_URL_1,
+ dict_to_return=IMAGEPAIR_1_AS_DICT))
image_pair_set.add_image_pair(
- MockImagePair(base_url=BASE_URL_1, dict_to_return=IMAGEPAIR_2_AS_DICT))
+ MockImagePair(imageA_base_url=BASE_URL_1, imageB_base_url=BASE_URL_1,
+ dict_to_return=IMAGEPAIR_2_AS_DICT))
# Call as_dict() with default or reasonable column_ids_in_order.
image_pair_set.as_dict()
image_pair_set.as_dict(column_ids_in_order=['test', 'builder'])
@@ -178,13 +185,14 @@ class ImagePairSetTest(unittest.TestCase):
class MockImagePair(object):
"""Mock ImagePair object, which will return canned results."""
- def __init__(self, base_url, dict_to_return):
+ def __init__(self, imageA_base_url, imageB_base_url, dict_to_return):
"""
Args:
base_url: base_url attribute for this object
dict_to_return: dictionary to return from as_dict()
"""
- self.base_url = base_url
+ self.imageA_base_url = imageA_base_url
+ self.imageB_base_url = imageB_base_url
self.extra_columns_dict = dict_to_return.get(
imagepair.KEY__IMAGEPAIRS__EXTRACOLUMNS, None)
self._dict_to_return = dict_to_return

Powered by Google App Engine
This is Rietveld 408576698