MCPcopy Index your code
hub / github.com/dbcli/mycli / test_binary_display_utf8

Function test_binary_display_utf8

test/pytests/test_main.py:137–167  ·  view source on GitHub ↗
(executor)

Source from the content-addressed store, hash-verified

135@dbtest
136@pytest.mark.skipif(os.name == 'nt', reason='todo: unknown')
137def test_binary_display_utf8(executor):
138 m = MyCli()
139 m.sqlexecute = SQLExecute(
140 None,
141 USER,
142 PASSWORD,
143 HOST,
144 PORT,
145 None,
146 None,
147 None,
148 None,
149 None,
150 )
151 m.explicit_pager = False
152 sqlresult = next(m.sqlexecute.run("select b'01101010' AS binary_test"))
153 formatted = m.format_sqlresult(
154 sqlresult,
155 is_expanded=False,
156 is_redirected=False,
157 null_string="<null>",
158 numeric_alignment="right",
159 binary_display="utf8",
160 max_width=None,
161 )
162 f = io.StringIO()
163 with redirect_stdout(f):
164 m.output(formatted, sqlresult)
165 expected = " j "
166 output = f.getvalue()
167 assert expected in output
168
169
170@dbtest

Callers

nothing calls this directly

Calls 5

SQLExecuteClass · 0.90
MyCliClass · 0.85
outputMethod · 0.80
runMethod · 0.45
format_sqlresultMethod · 0.45

Tested by

no test coverage detected