Skip to content

Commit f9bf273

Browse files
committed
t/python: add extra OutputFormat coverage
Problem: The current OutputFormat python tests always assume output headers are passed in. Add some tests that do not pass output headers in.
1 parent e06cd68 commit f9bf273

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

t/python/t0024-util.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ def test_filter(self):
218218
).filter(items)
219219
self.assertEqual(fmt, "{i:>8} {f:5.2f}")
220220

221+
fmt = OutputFormat(
222+
"?+:{i:>7} ?:{s:>6} ?+:{f:.2f}", headings=None
223+
).filter(items)
224+
self.assertEqual(fmt, "{i:>8} {f:3.2f}")
225+
221226
def test_sort(self):
222227
a = Item("a", 0, 2.2)
223228
d = Item("d", 33, 1.1)
@@ -270,6 +275,11 @@ def test_issue6530(self):
270275
).filter(items)
271276
self.assertEqual(fmt, "{s:16.16} {i:7d} {f:5.2f}")
272277

278+
fmt = OutputFormat(
279+
"+:{s:5.5} +:{i:4d} +:{f:.2f}", headings=None
280+
).filter(items)
281+
self.assertEqual(fmt, "{s:16.16} {i:4d} {f:3.2f}")
282+
273283
def test_copy(self):
274284
original = "+:{s:5.5} {i:4d} {f:.2f}"
275285

0 commit comments

Comments
 (0)