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

Function test_binary_display_hex

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

Source from the content-addressed store, hash-verified

100@dbtest
101@pytest.mark.skipif(os.name == 'nt', reason='todo: unknown; try running the test suite under winpty')
102def test_binary_display_hex(executor):
103 m = MyCli()
104 m.sqlexecute = SQLExecute(
105 None,
106 USER,
107 PASSWORD,
108 HOST,
109 PORT,
110 None,
111 None,
112 None,
113 None,
114 None,
115 )
116 m.explicit_pager = False
117 sqlresult = next(m.sqlexecute.run("select b'01101010' AS binary_test"))
118 formatted = m.format_sqlresult(
119 sqlresult,
120 is_expanded=False,
121 is_redirected=False,
122 null_string="<null>",
123 numeric_alignment="right",
124 binary_display="hex",
125 max_width=None,
126 )
127 f = io.StringIO()
128 with redirect_stdout(f):
129 m.output(formatted, sqlresult)
130 expected = " 0x6a "
131 output = f.getvalue()
132 assert expected in output
133
134
135@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