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

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: 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
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
epoger 2014/02/07 21:36:17 don't truncate the diffs displayed by unittest in
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
epoger 2014/02/07 21:36:17 If you think it's important, I can tackle this bef
rmistry 2014/02/10 17:34:54 Does this hit the HTTP Google Storage or Google St
epoger 2014/02/10 18:01:16 You're right, it hits Google Storage via HTTP. No
+ 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],
],

Powered by Google App Engine
This is Rietveld 408576698