File size: 488 Bytes
3b27d22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import unittest
from PIL import Image
from app import import_and_predict


class TestApp(unittest.TestCase):

    def test_import_and_predict(self):
        image_data = Image.new('RGB', (100, 100))  # Mock image data
        caption = import_and_predict(image_data)  # Call the function
        self.assertIsInstance(caption, str)  # Check if caption is a string
        self.assertTrue(len(caption) > 0)  # Check if caption is not empty


if __name__ == '__main__':
    unittest.main()