test_para_pipeline.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import unittest
  2. """
  3. Execute the following command to run the tests under directory code-clean:
  4. python -m tests.test_para.test_para_pipeline
  5. or
  6. pytest -v -s app/pdf_toolbox/tests/test_para/test_para_pipeline.py
  7. """
  8. from tests.test_para.test_pdf2text_recogPara_Common import (
  9. TestIsBboxOverlap,
  10. TestIsInBbox,
  11. TestIsBboxOverlap,
  12. TestIsLineLeftAlignedFromNeighbors,
  13. TestIsLineRightAlignedFromNeighbors,
  14. )
  15. from tests.test_para.test_pdf2text_recogPara_EquationsProcessor import TestCalcOverlapPct
  16. from tests.test_para.test_pdf2text_recogPara_BlockInnerParasProcessor import TestIsConsistentLines
  17. from tests.test_para.test_pdf2text_recogPara_BlockContinuationProcessor import (
  18. TestIsAlphabetChar,
  19. TestIsChineseChar,
  20. TestIsOtherLetterChar,
  21. )
  22. from tests.test_para.test_pdf2text_recogPara_TitleProcessor import TestTitleProcessor
  23. # Test suite
  24. suite = unittest.TestSuite()
  25. # Test cases from test_pdf2text_recogPara_Common
  26. suite.addTest(unittest.makeSuite(TestIsBboxOverlap))
  27. suite.addTest(unittest.makeSuite(TestIsInBbox))
  28. suite.addTest(unittest.makeSuite(TestIsBboxOverlap))
  29. suite.addTest(unittest.makeSuite(TestIsLineLeftAlignedFromNeighbors))
  30. suite.addTest(unittest.makeSuite(TestIsLineRightAlignedFromNeighbors))
  31. # Test cases from test_pdf2text_recogPara_EquationsProcessor
  32. suite.addTest(unittest.makeSuite(TestCalcOverlapPct))
  33. # Test cases from test_pdf2text_recogPara_BlockInnerParasProcessor
  34. suite.addTest(unittest.makeSuite(TestIsConsistentLines))
  35. # Test cases from test_pdf2text_recogPara_BlockContinuationProcessor
  36. suite.addTest(unittest.makeSuite(TestIsAlphabetChar))
  37. suite.addTest(unittest.makeSuite(TestIsChineseChar))
  38. suite.addTest(unittest.makeSuite(TestIsOtherLetterChar))
  39. # Test cases from test_pdf2text_recogPara_TitleProcessor
  40. suite.addTest(unittest.makeSuite(TestTitleProcessor))
  41. # Run test suite
  42. unittest.TextTestRunner(verbosity=2).run(suite)