Test that not setting any column date formats returns unaltered datetime columns
()
| 103 | |
| 104 | |
| 105 | def test_no_column_date_formats(): |
| 106 | """Test that not setting any column date formats returns unaltered datetime columns""" |
| 107 | settings = OutputSettings(table_format="psql") |
| 108 | data = [ |
| 109 | ("name1", "2024-12-13T18:32:22", "2024-12-13T19:32:22", "2024-12-13T20:32:22"), |
| 110 | ("name2", "2025-02-13T02:32:22", "2025-02-13T02:32:22", "2025-02-13T02:32:22"), |
| 111 | ] |
| 112 | headers = ["name", "date_col", "datetime_col", "unchanged_col"] |
| 113 | |
| 114 | results = format_output("Title", data, headers, "test status", settings) |
| 115 | expected = [ |
| 116 | "Title", |
| 117 | "+-------+---------------------+---------------------+---------------------+", |
| 118 | "| name | date_col | datetime_col | unchanged_col |", |
| 119 | "|-------+---------------------+---------------------+---------------------|", |
| 120 | "| name1 | 2024-12-13T18:32:22 | 2024-12-13T19:32:22 | 2024-12-13T20:32:22 |", |
| 121 | "| name2 | 2025-02-13T02:32:22 | 2025-02-13T02:32:22 | 2025-02-13T02:32:22 |", |
| 122 | "+-------+---------------------+---------------------+---------------------+", |
| 123 | "test status", |
| 124 | ] |
| 125 | assert list(results) == expected |
| 126 | |
| 127 | |
| 128 | def test_format_output_truncate_on(): |
nothing calls this directly
no test coverage detected