"Fossies" - the Fresh Open Source Software Archive

Member "xhtml2pdf-0.2.2/tests/test_reportlab.py" (16 Apr 2018, 1396 Bytes) of package /linux/www/xhtml2pdf-0.2.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 import unittest
    2 from xhtml2pdf import xhtml2pdf_reportlab
    3 
    4 
    5 class PTCycleTest(unittest.TestCase):
    6     def test_init(self):
    7         xhtml2pdf_reportlab.PTCycle()
    8 
    9     def test_cyclicIterator(self):
   10         ptcycle = xhtml2pdf_reportlab.PTCycle()
   11         ptcycle.extend(range(10))
   12         for ele in ptcycle:
   13             pass
   14 
   15 
   16 class PmlMaxHeightMixInTest(unittest.TestCase):
   17     def test_setMaxHeight_height_lt_70000(self):
   18         pmlmaxheightmixin = xhtml2pdf_reportlab.PmlMaxHeightMixIn()
   19         pmlmaxheightmixin.setMaxHeight(69999)
   20 
   21     # def test_setMaxHeight_height_lt_70000_and_canv(self):
   22     #     pmlmaxheightmixin = xhtml2pdf_reportlab.PmlMaxHeightMixIn()
   23     #     pmlmaxheightmixin.setMaxHeight(69999)
   24 
   25     # def test_setMaxHeight_height_lt_70000_and_canv_with_height(self):
   26     #     pmlmaxheightmixin = xhtml2pdf_reportlab.PmlMaxHeightMixIn()
   27     #     pmlmaxheightmixin.setMaxHeight(69999)
   28 
   29     def test_setMaxHeight_height_gte_70000(self):
   30         pmlmaxheightmixin = xhtml2pdf_reportlab.PmlMaxHeightMixIn()
   31         pmlmaxheightmixin.setMaxHeight(70000)
   32 
   33     def test_getMaxHeight(self):
   34         pmlmaxheightmixin = xhtml2pdf_reportlab.PmlMaxHeightMixIn()
   35         self.assertEqual(0, pmlmaxheightmixin.getMaxHeight())
   36         pmlmaxheightmixin.availHeightValue = 42
   37         self.assertEqual(42, pmlmaxheightmixin.getMaxHeight())
   38 
   39 
   40 if __name__ == "__main__":
   41     unittest.main()