From 24c69ee422251a834254f45874209b3774f13d4c Mon Sep 17 00:00:00 2001 From: leohsiao Date: Sat, 5 Oct 2024 17:20:16 +0800 Subject: [PATCH] [test] add test cases for get_pixel_width() and get_pixel_height() --- pyexiv2/tests/data/data.py | 2 ++ pyexiv2/tests/test_func.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/pyexiv2/tests/data/data.py b/pyexiv2/tests/data/data.py index 57c5e07..1986e86 100644 --- a/pyexiv2/tests/data/data.py +++ b/pyexiv2/tests/data/data.py @@ -12,6 +12,8 @@ with open(os.path.join(current_dir, '1-thumb.jpg'), 'rb') as f: EXIF_THUMB = f.read() +PIXEL_WIDTH = 200 +PIXEL_HEIGHT = 200 MIME_TYPE = 'image/jpeg' ACCESS_MODE = { diff --git a/pyexiv2/tests/test_func.py b/pyexiv2/tests/test_func.py index 132e4c3..1dc49af 100644 --- a/pyexiv2/tests/test_func.py +++ b/pyexiv2/tests/test_func.py @@ -49,6 +49,16 @@ def _test_chinese_path(): os.remove(chinese_path) +def test_get_pixel_width(): + assert ENV.img.get_pixel_width() == data.PIXEL_WIDTH + check_img_md5() + + +def test_get_pixel_height(): + assert ENV.img.get_pixel_height() == data.PIXEL_HEIGHT + check_img_md5() + + def test_get_mime_type(): assert ENV.img.get_mime_type() == data.MIME_TYPE check_img_md5()