-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_cv_module.py
More file actions
26 lines (18 loc) · 855 Bytes
/
test_cv_module.py
File metadata and controls
26 lines (18 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# pylint: disable=missing-docstring, no-member, import-outside-toplevel, unused-import, wrong-import-order, no-name-in-module, redefined-outer-name, protected-access, line-too-long, duplicate-code , assignment-from-none, wrong-import-position
import unittest
from PIL import Image
from cv_module import CVModule
class TestCVModule(unittest.TestCase):
def setUp(self):
self.cv = CVModule()
def test_detect_objects(self):
# Create a dummy image for testing
image = Image.new("RGB", (100, 100), color="white")
result = self.cv.detect_objects(image)
self.assertIsNotNone(result)
self.assertIsInstance(result, str)
def test_detect_objects_invalid_image(self):
with self.assertRaises(ValueError):
self.cv.detect_objects(None)
if __name__ == "__main__":
unittest.main()