Skip to content

Commit

Permalink
Create test_generate_embeddings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsimran-Dalal authored Oct 28, 2024
1 parent 8ce87a2 commit b20a1f6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test_generate_embeddings.py
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()

0 comments on commit b20a1f6

Please sign in to comment.