/ test / python / testpipeline / testimage / testcaption.py
testcaption.py
 1  """
 2  Caption module tests
 3  """
 4  
 5  import unittest
 6  
 7  from PIL import Image
 8  
 9  from txtai.pipeline import Caption
10  
11  # pylint: disable=C0411
12  from utils import Utils
13  
14  
15  class TestCaption(unittest.TestCase):
16      """
17      Caption tests.
18      """
19  
20      def testCaption(self):
21          """
22          Test captions
23          """
24  
25          caption = Caption()
26          self.assertEqual(caption(Image.open(Utils.PATH + "/books.jpg")), "a book shelf filled with books and a stack of books")