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

Unified Diff: gm/rebaseline_server/imagediffdb_test.py

Issue 157593006: rebaseline_server: add ImagePair class, a step towards new intermediate JSON schema (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: style fix Created 6 years, 10 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
« no previous file with comments | « gm/rebaseline_server/imagediffdb.py ('k') | gm/rebaseline_server/imagepair.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/imagediffdb_test.py
diff --git a/gm/rebaseline_server/imagediffdb_test.py b/gm/rebaseline_server/imagediffdb_test.py
index b76a2c0898671a8f1c4938d73bc8cb337fd28904..558a816a02cbbb6a05dea1bd9884c7e6d6cd4049 100755
--- a/gm/rebaseline_server/imagediffdb_test.py
+++ b/gm/rebaseline_server/imagediffdb_test.py
@@ -26,6 +26,7 @@ class ImageDiffDbTest(unittest.TestCase):
def setUp(self):
self._temp_dir = tempfile.mkdtemp()
+ self.maxDiff = None
def tearDown(self):
shutil.rmtree(self._temp_dir)
@@ -34,7 +35,20 @@ class ImageDiffDbTest(unittest.TestCase):
"""Tell unittest framework to not print docstrings for test cases."""
return None
+ def test_sanitize_locator(self):
+ """Test _sanitize_locator()."""
+ self.assertEqual(imagediffdb._sanitize_locator('simple'), 'simple')
+ self.assertEqual(imagediffdb._sanitize_locator(1234), '1234')
+ self.assertEqual(imagediffdb._sanitize_locator('one/two'), 'one_two')
+ self.assertEqual(imagediffdb._sanitize_locator('one\\two'), 'one_two')
+ self.assertEqual(imagediffdb._sanitize_locator('one_two'), 'one_two')
+
def test_simple(self):
+ """Test ImageDiffDB, downloading real known images from Google Storage.
+
+ TODO(epoger): Instead of hitting Google Storage, we should read image
+ files from local disk using a file:// IMG_URL_BASE.
+ """
# params for each self-test:
# 0. expected image locator
# 1. expected image URL
@@ -45,16 +59,16 @@ class ImageDiffDbTest(unittest.TestCase):
# 6. expected max_diff_per_channel
selftests = [
[
- '16206093933823793653',
+ 'arcofzorro/16206093933823793653',
IMG_URL_BASE + 'arcofzorro/16206093933823793653.png',
- '13786535001616823825',
+ 'arcofzorro/13786535001616823825',
IMG_URL_BASE + 'arcofzorro/13786535001616823825.png',
'0.0662', '0.0113', [255, 255, 247],
],
[
- '10552995703607727960',
+ 'gradients_degenerate_2pt/10552995703607727960',
IMG_URL_BASE + 'gradients_degenerate_2pt/10552995703607727960.png',
- '11198253335583713230',
+ 'gradients_degenerate_2pt/11198253335583713230',
IMG_URL_BASE + 'gradients_degenerate_2pt/11198253335583713230.png',
'100.0000', '66.6667', [255, 0, 255],
],
« no previous file with comments | « gm/rebaseline_server/imagediffdb.py ('k') | gm/rebaseline_server/imagepair.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698