Ejemplo n.º 1
0
    def test_expand_content(self):
        table = etree.XML(TABLE_REP_7x7_EXPAND_ALL)
        normalize_table(table, expand='all')

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(7, nrows)
        self.assertEqual(7, ncols)
Ejemplo n.º 2
0
    def test_expand_content(self):
        table = etree.XML(TABLE_REP_7x11_ALL_LESS_MAXCOUNT)
        normalize_table(table, expand="all_less_maxcount", maxcount=(32, 32))

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(11, nrows)
        self.assertEqual(7, ncols)
Ejemplo n.º 3
0
    def test_uncompressed_content(self):
        table = etree.XML(TABLE_5x3)
        normalize_table(table)

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(5, nrows)
        self.assertEqual(3, ncols)
Ejemplo n.º 4
0
    def test_expand_content(self):
        table = etree.XML(TABLE_REP_7x7_ALL_BUT_LAST)
        normalize_table(table, expand="all_but_last")

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(7, nrows)
        self.assertEqual(7, ncols)
Ejemplo n.º 5
0
    def test_uncompressed_content(self):
        table = etree.XML(TABLE_5x3)
        normalize_table(table)

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(5, nrows)
        self.assertEqual(3, ncols)
Ejemplo n.º 6
0
    def test_expand_content(self):
        table = etree.XML(TABLE_REP_7x7_EXPAND_ALL)
        normalize_table(table, expand='all')

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(7, nrows)
        self.assertEqual(7, ncols)
Ejemplo n.º 7
0
    def test_expand_content(self):
        table = etree.XML(TABLE_REP_7x11_ALL_LESS_MAXCOUNT)
        normalize_table(table, expand="all_less_maxcount", maxcount=(32, 32))

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(11, nrows)
        self.assertEqual(7, ncols)
Ejemplo n.º 8
0
    def test_expand_content(self):
        table = etree.XML(TABLE_REP_7x7_ALL_BUT_LAST)
        normalize_table(table, expand="all_but_last")

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(7, nrows)
        self.assertEqual(7, ncols)
Ejemplo n.º 9
0
    def test_expand_content_ignore_last_repetition(self):
        # Last row is repeated only once, repetition attribute of last row/col is ignored
        table = etree.XML(TABLE_REP_7x7_ALL_BUT_LAST_2)
        normalize_table(table, expand="all_but_last")

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(7, nrows)
        self.assertEqual(7, ncols)
Ejemplo n.º 10
0
    def test_expand_content_ignore_last_repetition(self):
        # Last row is repeated only once, repetition attribute of last row/col is ignored
        table = etree.XML(TABLE_REP_7x7_ALL_BUT_LAST_2)
        normalize_table(table, expand="all_but_last")

        nrows, ncols = get_nrows_ncols(table)
        self.assertEqual(7, nrows)
        self.assertEqual(7, ncols)
Ejemplo n.º 11
0
 def test_init_node_error(self):
     with self.assertRaises(ValueError):
         normalize_table(xmlnode=etree.Element(CN('error')))
Ejemplo n.º 12
0
 def test_align_table_rows(self):
     normalize_table(self.table)
     cmin, cmax = get_min_max_cell_count(self.table)
     self.assertEqual(3, cmin, "table contains rows with cell-count < 3.")
Ejemplo n.º 13
0
 def test_init_node_error(self):
     with self.assertRaises(ValueError):
         normalize_table(xmlnode=etree.Element(CN('error')))
Ejemplo n.º 14
0
 def test_align_table_rows(self):
     normalize_table(self.table)
     cmin, cmax = get_min_max_cell_count(self.table)
     self.assertEqual(3, cmin, "table contains rows with cell-count < 3.")