()
| 17 | |
| 18 | |
| 19 | def test_raise_mysql_exception(): |
| 20 | data = b"\xff\x15\x04#28000Access denied" |
| 21 | with pytest.raises(err.OperationalError) as cm: |
| 22 | err.raise_mysql_exception(data) |
| 23 | assert cm.type == err.OperationalError |
| 24 | assert cm.value.args == (1045, "Access denied") |
| 25 | assert cm.value.sqlstate == "28000" |
| 26 | |
| 27 | data = b"\xff\x10\x04Too many connections" |
| 28 | with pytest.raises(err.OperationalError) as cm: |
| 29 | err.raise_mysql_exception(data) |
| 30 | assert cm.type == err.OperationalError |
| 31 | assert cm.value.args == (1040, "Too many connections") |
| 32 | assert cm.value.sqlstate is None |
| 33 | |
| 34 | |
| 35 | def test_set_charset_deprecated(): |
nothing calls this directly
no outgoing calls
no test coverage detected