Exemplo n.º 1
0
 def test_to_formatted_string(self):
     table = OutputTable(headers=TEST_HEADERS)
     for row in TEST_ROWS:
         table.add_row(row)
     self.assertEqual(
         table.to_formatted_string(column_width=TEST_COLUMN_WIDTH),
         TEST_TABLE_STR)
     self.assertEqual(table.to_formatted_string(separator=','),
                      TEST_CSV_STR)
Exemplo n.º 2
0
    def test_to_formatted_string(self):
        table = OutputTable(headers=TEST_HEADERS)
        for row in TEST_ROWS:
            table.add_row(row)
        self.assertEqual(table.to_formatted_string(), TEST_TABLE_STR)

        table = OutputTable(headers=TEST_HEADERS)
        for row in TEST_ROWS:
            table.add_row(row)
        self.assertEqual(
            table.to_formatted_string(separator=',', ignore_widths=True),
            TEST_CSV_STR)