/usr/lib/python3/dist-packages/pymysql/tests/test_err.py is in python3-pymysql 0.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import unittest2
from pymysql import err
__all__ = ["TestRaiseException"]
class TestRaiseException(unittest2.TestCase):
def test_raise_mysql_exception(self):
data = b"\xff\x15\x04Access denied"
with self.assertRaises(err.OperationalError) as cm:
err.raise_mysql_exception(data)
self.assertEqual(cm.exception.args, (1045, 'Access denied'))
def test_raise_mysql_exception_client_protocol_41(self):
data = b"\xff\x15\x04#28000Access denied"
with self.assertRaises(err.OperationalError) as cm:
err.raise_mysql_exception(data)
self.assertEqual(cm.exception.args, (1045, 'Access denied'))
|