/ test / python / testpipeline / testdata / testfiletohtml.py
testfiletohtml.py
 1  """
 2  FileToHTML module tests
 3  """
 4  
 5  import os
 6  import unittest
 7  
 8  from unittest.mock import patch
 9  
10  from txtai.pipeline.data.filetohtml import Tika
11  
12  
13  class TestFileToHTML(unittest.TestCase):
14      """
15      FileToHTML tests.
16      """
17  
18      @patch.dict(os.environ, {"TIKA_JAVA": "1112444abc"})
19      def testTika(self):
20          """
21          Test the Tika.available returns False when Java is not available
22          """
23  
24          self.assertFalse(Tika.available())