(executor)
| 135 | @dbtest |
| 136 | @pytest.mark.skipif(os.name == 'nt', reason='todo: unknown') |
| 137 | def 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 |
nothing calls this directly
no test coverage detected