-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ce87a2
commit b20a1f6
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import unittest | ||
from face_recognition_module import generate_embeddings # Replace with actual module name | ||
|
||
class TestGenerateEmbeddings(unittest.TestCase): | ||
def test_invalid_face_data(self): | ||
"""Test case for invalid input data to `generate_embeddings`.""" | ||
invalid_face_data = None | ||
with self.assertRaises(TypeError): | ||
generate_embeddings(invalid_face_data) | ||
|
||
def test_empty_face_data(self): | ||
"""Test case for empty face data input.""" | ||
empty_face_data = [] | ||
with self.assertRaises(ValueError): | ||
generate_embeddings(empty_face_data) | ||
|
||
def test_large_face_data(self): | ||
"""Test case for overly large face data input.""" | ||
# Simulate very large input | ||
large_face_data = [0.1] * 10000 # Example of a large data array | ||
with self.assertRaises(ValueError): | ||
generate_embeddings(large_face_data) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |