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)
    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)
    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)
    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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
    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)
Esempio 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)
Esempio n. 11
0
 def test_init_node_error(self):
     with self.assertRaises(ValueError):
         normalize_table(xmlnode=etree.Element(CN('error')))
Esempio 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.")
Esempio n. 13
0
 def test_init_node_error(self):
     with self.assertRaises(ValueError):
         normalize_table(xmlnode=etree.Element(CN('error')))
Esempio 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.")