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

Unified Diff: tools/telemetry/telemetry/image_processing/image_util_unittest.py

Issue 865653004: Document and test that image_util.WritePngFile requires path end in 'png'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review feedback from sullivan. Created 5 years, 11 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 | « tools/telemetry/telemetry/image_processing/image_util_numpy_impl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/image_processing/image_util_unittest.py
diff --git a/tools/telemetry/telemetry/image_processing/image_util_unittest.py b/tools/telemetry/telemetry/image_processing/image_util_unittest.py
index 0102e214b278aec268c7e1eca64a7f494c012226..540bf3e83edf2061d65f0fa838802a612ac2c78b 100644
--- a/tools/telemetry/telemetry/image_processing/image_util_unittest.py
+++ b/tools/telemetry/telemetry/image_processing/image_util_unittest.py
@@ -51,6 +51,12 @@ class ImageUtilTest(unittest.TestCase):
new_file = image_util.FromPngFile(temp_file)
self.assertTrue(image_util.AreEqual(orig, new_file, likely_equal=True))
+ def testWritePngWithoutPngSuffixThrows(self):
+ orig = image_util.FromPngFile(test_png_path)
+ temp_file = tempfile.NamedTemporaryFile().name
+ self.assertRaises(AssertionError, image_util.WritePngFile,
+ orig, temp_file)
+
def testWriteCroppedBmpToPngFile(self):
pixels = [255,0,0, 255,255,0, 0,0,0,
255,255,0, 0,255,0, 0,0,0]
« no previous file with comments | « tools/telemetry/telemetry/image_processing/image_util_numpy_impl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698