()
| 75 | |
| 76 | |
| 77 | def test_column_date_formats(): |
| 78 | settings = OutputSettings( |
| 79 | table_format="psql", |
| 80 | column_date_formats={ |
| 81 | "date_col": "%Y-%m-%d", |
| 82 | "datetime_col": "%I:%M:%S %m/%d/%y", |
| 83 | }, |
| 84 | ) |
| 85 | data = [ |
| 86 | ("name1", "2024-12-13T18:32:22", "2024-12-13T19:32:22", "2024-12-13T20:32:22"), |
| 87 | ("name2", "2025-02-13T02:32:22", "2025-02-13T02:32:22", "2025-02-13T02:32:22"), |
| 88 | ] |
| 89 | headers = ["name", "date_col", "datetime_col", "unchanged_col"] |
| 90 | |
| 91 | results = format_output("Title", data, headers, "test status", settings) |
| 92 | expected = [ |
| 93 | "Title", |
| 94 | "+-------+------------+-------------------+---------------------+", |
| 95 | "| name | date_col | datetime_col | unchanged_col |", |
| 96 | "|-------+------------+-------------------+---------------------|", |
| 97 | "| name1 | 2024-12-13 | 07:32:22 12/13/24 | 2024-12-13T20:32:22 |", |
| 98 | "| name2 | 2025-02-13 | 02:32:22 02/13/25 | 2025-02-13T02:32:22 |", |
| 99 | "+-------+------------+-------------------+---------------------+", |
| 100 | "test status", |
| 101 | ] |
| 102 | assert list(results) == expected |
| 103 | |
| 104 | |
| 105 | def test_no_column_date_formats(): |
nothing calls this directly
no test coverage detected