LittleDemon WebShell


Linux server27.hostingraja.org 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64
Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/pymysql/tests/
File Upload :
Command :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/pymysql/tests/test_err.py

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'))

LittleDemon - FACEBOOK
[ KELUAR ]