MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / test_format_output

Method test_format_output

tests/test_main.py:35–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34 @staticmethod
35 def test_format_output():
36 mssqlcli = create_mssql_cli()
37 settings = OutputSettings(table_format='psql', dcmlfmt='d', floatfmt='g')
38 results = mssqlcli.format_output(
39 'Title',
40 [('abc', 'def')],
41 ['head1', 'head2'],
42 'test status',
43 settings
44 )
45 expected = [
46 'Title',
47 '+---------+---------+',
48 '| head1 | head2 |',
49 '|---------+---------|',
50 '| abc | def |',
51 '+---------+---------+',
52 'test status'
53 ]
54 assert list(results) == expected
55
56 def test_format_output_live_connection(self):
57 statement = u"""

Callers

nothing calls this directly

Calls 2

create_mssql_cliFunction · 0.90
format_outputMethod · 0.80

Tested by

no test coverage detected