Beispiel #1
0
 def setUp(self):
     self.stream = StringIO()
     self.table = Table()
     self.table.create_rows(['row1', 'row2', 'row3'])
     self.table.create_columns(['col1', 'col2'])
     self.writer = DocbookTableWriter(self.stream, self.table, None)
     self.writer.set_renderer(DocbookRenderer())
 def setUp(self):
     self.stream = StringIO()
     self.table = Table()
     self.table.create_rows(['row1', 'row2', 'row3'])
     self.table.create_columns(['col1', 'col2'])
     self.writer = DocbookTableWriter(self.stream, self.table, None)
     self.writer.set_renderer(DocbookRenderer())
 def setUp(self):
     self.stream = StringIO()
     self.table = Table()
     self.table.create_rows(["row1", "row2", "row3"])
     self.table.create_columns(["col1", "col2"])
     self.writer = DocbookTableWriter(self.stream, self.table, None)
     self.writer.set_renderer(DocbookRenderer())
class DocbookTableWriterTC(TestCase):
    """TestCase for table's writer"""
    def setUp(self):
        self.stream = StringIO()
        self.table = Table()
        self.table.create_rows(['row1', 'row2', 'row3'])
        self.table.create_columns(['col1', 'col2'])
        self.writer = DocbookTableWriter(self.stream, self.table, None)
        self.writer.set_renderer(DocbookRenderer())

    def test_write_table(self):
        """make sure write_table() doesn't raise any exception"""
        self.writer.write_table()

    def test_abstract_writer(self):
        """tests that Abstract Writers can't be used !"""
        writer = TableWriter(self.stream, self.table, None)
        self.assertRaises(NotImplementedError, writer.write_table)
Beispiel #5
0
class DocbookTableWriterTC(TestCase):
    """TestCase for table's writer"""
    def setUp(self):
        self.stream = StringIO()
        self.table = Table()
        self.table.create_rows(['row1', 'row2', 'row3'])
        self.table.create_columns(['col1', 'col2'])
        self.writer = DocbookTableWriter(self.stream, self.table, None)
        self.writer.set_renderer(DocbookRenderer())

    def test_write_table(self):
        """make sure write_table() doesn't raise any exception"""
        self.writer.write_table()

    def test_abstract_writer(self):
        """tests that Abstract Writers can't be used !"""
        writer = TableWriter(self.stream, self.table, None)
        self.assertRaises(NotImplementedError, writer.write_table)