Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed May 30, 2024
1 parent c50e6c3 commit 29738af
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 0 additions & 1 deletion example_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from dotenv import load_dotenv
import os


# Load environment variables
load_dotenv()

Expand Down
24 changes: 24 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import unittest
# Assuming the class is in this module
from uugai_python_color_prediction.ColorPrediction import ColorPrediction


class TestColorPrediction(unittest.TestCase):
def test_find_main_colors(self):
# Assuming we have a test image at 'assets/test_image.jpg'
# test_image = 'assets/test_image.jpg'
# main_colors, _, _ = ColorPrediction.find_main_colors(image=read_first_frame(test_image),
# min_clusters=1,
# max_clusters=5,
# downsample_factor=0.95,
# increase_elbow=0,
# verbose=False,
# plot=False)
# Assuming we know the main colors for the test image
# expected_main_colors = [...] # Replace with the expected main colors
# self.assertEqual(main_colors.tolist(), expected_main_colors)
self.assertEqual(1, 1)


if __name__ == '__main__':
unittest.main()

0 comments on commit 29738af

Please sign in to comment.