Skip to content

Commit

Permalink
[REFACTOR]: refactor test module
Browse files Browse the repository at this point in the history
  • Loading branch information
johnson-magic committed Sep 25, 2024
1 parent 8359634 commit ad10222
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
File renamed without changes
9 changes: 7 additions & 2 deletions tests/test_read.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import os
import unittest
import numpy as np
from PIL import Image

from ttool.read import ReadImage

current_file_path = os.path.abspath(__file__)
current_directory = os.path.dirname(current_file_path)


class TestReadMethods(unittest.TestCase):

def test_ReadImage(self):
img_pillow = ReadImage("./data/color.png", "pillow")
path_test_data = os.path.join(current_directory, "./data/color.jpg")
img_pillow = ReadImage(path_test_data, "pillow")
self.assertTrue(isinstance(img_pillow, Image.Image))

img_opencv = ReadImage("./data/color.png", "opencv")
img_opencv = ReadImage(path_test_data, "opencv")
self.assertTrue(isinstance(img_opencv, np.ndarray))


Expand Down

0 comments on commit ad10222

Please sign in to comment.