Chromium Code Reviews| 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], |
| ], |