-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·24 lines (20 loc) · 809 Bytes
/
test.py
File metadata and controls
executable file
·24 lines (20 loc) · 809 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
#!/usr/bin/env python3
import numpy as np
import cv2
import unittest
# Import the functions we want to test.
from main import process_frame
# This is an example of building a test suite using Python's unittest module.
class MyTestCase(unittest.TestCase):
def test_stats(self):
frame = cv2.imread("test.jpg")
results = process_frame(frame)
self.assertLessEqual(results["min"][0], results["max"][0])
self.assertLessEqual(results["min"][1], results["max"][1])
self.assertLessEqual(results["min"][2], results["max"][2])
# You can add your own test_something functions below to expand the test!
def test_something(self):
self.assertTrue(1 == 1)
# This will run all the tests when this file is executed.
if __name__ == "__main__":
unittest.main()