Skip to content

Commit

Permalink
[test] add test cases for get_pixel_width() and get_pixel_height()
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoHsiao1 committed Oct 5, 2024
1 parent 5845caa commit 24c69ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyexiv2/tests/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
10 changes: 10 additions & 0 deletions pyexiv2/tests/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 24c69ee

Please sign in to comment.