(executor)
| 100 | @dbtest |
| 101 | @pytest.mark.skipif(os.name == 'nt', reason='todo: unknown; try running the test suite under winpty') |
| 102 | def 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 |
nothing calls this directly
no test coverage detected