Exemplo n.º 1
0
 def runTest(self):
     # ARRANGE #
     root = Element('root')
     table = Table(TableFormat(first_row_is_header=True),
                   [
                       [text_cell('ignored'), text_cell('ignored')],
                       [text_cell('ignored'), text_cell('ignored')],
                   ])
     # ACT #
     ret_val = sut.render(ConstantPRenderer('para text'),
                          root, table)
     # ASSERT #
     xml_string = as_unicode_str(root)
     self.assertEqual('<root>'
                      '<table>'
                      '<tr>'
                      '<th>para text</th>'
                      '<th>para text</th>'
                      '</tr>'
                      '<tr>'
                      '<td>para text</td>'
                      '<td>para text</td>'
                      '</tr>'
                      '</table>'
                      '</root>',
                      xml_string)
     self.assertIs(list(root)[0],
                   ret_val)
Exemplo n.º 2
0
 def runTest(self):
     # ARRANGE #
     root = Element('root')
     table = Table(TableFormat(first_row_is_header=True), [
         [text_cell('ignored'), text_cell('ignored')],
         [text_cell('ignored'), text_cell('ignored')],
     ])
     # ACT #
     ret_val = sut.render(ConstantPRenderer('para text'), root, table)
     # ASSERT #
     xml_string = as_unicode_str(root)
     self.assertEqual(
         '<root>'
         '<table>'
         '<tr>'
         '<th>para text</th>'
         '<th>para text</th>'
         '</tr>'
         '<tr>'
         '<td>para text</td>'
         '<td>para text</td>'
         '</tr>'
         '</table>'
         '</root>', xml_string)
     self.assertIs(list(root)[0], ret_val)
Exemplo n.º 3
0
 def test_single_empty_row(self):
     # ARRANGE #
     root = Element('root')
     table = Table(TableFormat(), [[]])
     # ACT #
     ret_val = sut.render(ConstantPRenderer('para text'), root, table)
     # ASSERT #
     xml_string = as_unicode_str(root)
     self.assertEqual('<root />', xml_string)
     self.assertIs(root, ret_val)
Exemplo n.º 4
0
 def test_single_empty_row(self):
     # ARRANGE #
     root = Element('root')
     table = Table(TableFormat(),
                   [[]])
     # ACT #
     ret_val = sut.render(ConstantPRenderer('para text'),
                          root, table)
     # ASSERT #
     xml_string = as_unicode_str(root)
     self.assertEqual('<root />',
                      xml_string)
     self.assertIs(root,
                   ret_val)
Exemplo n.º 5
0
 def render_table(self, parent: Element, x: Table):
     return table_rendering.render(self, parent, x)
Exemplo n.º 6
0
 def render_table(self, parent: Element, x: Table):
     return table_rendering.render(self, parent, x)