diff --git a/test_generate_embeddings.py b/test_generate_embeddings.py new file mode 100644 index 0000000..aa0e5d7 --- /dev/null +++ b/test_generate_embeddings.py @@ -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()