diff options
author | Joakim Koljonen <koljonen@outlook.com> | 2017-08-06 19:24:16 +0200 |
---|---|---|
committer | Joakim Koljonen <koljonen@outlook.com> | 2017-08-06 19:30:47 +0200 |
commit | 13d8893427ddb3dc379569cce6556cae06ad14dc (patch) | |
tree | b2ac72eecd49f2742f3e4c2d6b184d89b088123b /tests/test_main.py | |
parent | c616a8b42272c2900a7306817d20b13fef3dc052 (diff) |
Reformat code for readability and linter happiness
Diffstat (limited to 'tests/test_main.py')
-rw-r--r-- | tests/test_main.py | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/tests/test_main.py b/tests/test_main.py index 249a4c69..4749481b 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -54,7 +54,15 @@ def test_format_output(): settings = OutputSettings(table_format='psql', dcmlfmt='d', floatfmt='g') results = format_output('Title', [('abc', 'def')], ['head1', 'head2'], 'test status', settings) - expected = ['Title', '+---------+---------+\n| head1 | head2 |\n|---------+---------|\n| abc | def |\n+---------+---------+', 'test status'] + expected = [ + 'Title', + '+---------+---------+\n' + '| head1 | head2 |\n' + '|---------+---------|\n' + '| abc | def |\n' + '+---------+---------+', + 'test status' + ] assert results == expected @@ -109,12 +117,30 @@ def test_format_output_auto_expand(): table_format='psql', dcmlfmt='d', floatfmt='g', max_width=100) table_results = format_output('Title', [('abc', 'def')], ['head1', 'head2'], 'test status', settings) - table = ['Title', '+---------+---------+\n| head1 | head2 |\n|---------+---------|\n| abc | def |\n+---------+---------+', 'test status'] + table = [ + 'Title', + '+---------+---------+\n' + '| head1 | head2 |\n' + '|---------+---------|\n' + '| abc | def |\n' + '+---------+---------+', + 'test status' + ] assert table_results == table - expanded_results = format_output('Title', [('abc', 'def')], - ['head1', 'head2'], 'test status', settings._replace(max_width=1)) + expanded_results = format_output( + 'Title', + [('abc', 'def')], + ['head1', 'head2'], + 'test status', + settings._replace(max_width=1) + ) expanded = [ - 'Title', u'-[ RECORD 1 ]-------------------------\nhead1 | abc\nhead2 | def\n', 'test status'] + 'Title', + u'-[ RECORD 1 ]-------------------------\n' + 'head1 | abc\n' + 'head2 | def\n', + 'test status' + ] assert expanded_results == expanded |