Commit edf0470b authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add test for a narrow terminal and using a tab for alignment.

This was missing according to coverage.
parent 81ef7c2d
......@@ -246,6 +246,18 @@ just now | in 2 days | in a day |
"""
self.assertEqual(self.output, result)
@mock.patch('topydo.lib.PrettyPrinterFilter.get_terminal_size')
def test_list_format14(self, mock_terminal_size):
mock_terminal_size.return_value = self.terminal_size(40, 25)
command = ListCommand(["-x", "-F", "|%I| %x %{(}p{)} %c %s %K", "@Context1"],
self.todolist, self.out, self.error)
command.execute()
result = u"""| 1| (D) 2015-08-31 Bar @Context1 +Project2 due:2015-09-30 t:2015-09-29
| 4| (C) Baz @Context1 +Project1 key:value
"""
self.assertEqual(self.output, result)
if __name__ == '__main__':
unittest.main()
......@@ -232,7 +232,7 @@ class PrettyPrinterAlignFilter(PrettyPrinterFilter):
if to_fill > 0:
p_todo_str = re.sub('\t', ' '*to_fill, p_todo_str)
elif to_fill <= 0:
else:
p_todo_str = re.sub('\t', ' ', p_todo_str)
return p_todo_str
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment