summaryrefslogtreecommitdiffstats
path: root/tests/test_main.py
diff options
context:
space:
mode:
authorFoxygrandpa <terkel919@gmail.com>2016-09-27 13:43:05 +0300
committerFoxygrandpa <terkel919@gmail.com>2016-09-27 13:43:28 +0300
commit0ef94c984b33a04de6b714343df156ae64b0d1b0 (patch)
tree09477b774d95892b8efbd9720301a0e2df85c25f /tests/test_main.py
parentfa4ebb5660519161c3342b13b23c0399f31539b5 (diff)
master: decimal and float format in config file
Diffstat (limited to 'tests/test_main.py')
-rw-r--r--tests/test_main.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_main.py b/tests/test_main.py
index ba11298c..e461fc0d 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -45,21 +45,22 @@ def test_obfuscate_process_password():
setproctitle.setproctitle(original_title)
+
def test_format_output():
results = format_output('Title', [('abc', 'def')], ['head1', 'head2'],
- 'test status', 'psql')
+ 'test status', 'psql', dcmlfmt='d', floatfmt='g',)
expected = ['Title', '+---------+---------+\n| head1 | head2 |\n|---------+---------|\n| abc | def |\n+---------+---------+', 'test status']
assert results == expected
def test_format_output_auto_expand():
table_results = format_output('Title', [('abc', 'def')],
- ['head1', 'head2'], 'test status', 'psql',
+ ['head1', 'head2'], 'test status', 'psql', dcmlfmt='d', floatfmt='g',
max_width=100)
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', 'psql',
+ ['head1', 'head2'], 'test status', 'psql', dcmlfmt='d', floatfmt='g',
max_width=1)
expanded = ['Title', u'-[ RECORD 0 ]-------------------------\nhead1 | abc\nhead2 | def\n', 'test status']
assert expanded_results == expanded