main
Last change
on this file was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100755
|
File size:
670 bytes
|
Line | |
---|
1 | import unittest2 |
---|
2 | |
---|
3 | from pymysql import err |
---|
4 | |
---|
5 | |
---|
6 | __all__ = ["TestRaiseException"] |
---|
7 | |
---|
8 | |
---|
9 | class TestRaiseException(unittest2.TestCase): |
---|
10 | |
---|
11 | def test_raise_mysql_exception(self): |
---|
12 | data = b"\xff\x15\x04Access denied" |
---|
13 | with self.assertRaises(err.OperationalError) as cm: |
---|
14 | err.raise_mysql_exception(data) |
---|
15 | self.assertEqual(cm.exception.args, (1045, 'Access denied')) |
---|
16 | |
---|
17 | def test_raise_mysql_exception_client_protocol_41(self): |
---|
18 | data = b"\xff\x15\x04#28000Access denied" |
---|
19 | with self.assertRaises(err.OperationalError) as cm: |
---|
20 | err.raise_mysql_exception(data) |
---|
21 | self.assertEqual(cm.exception.args, (1045, 'Access denied')) |
---|
Note: See
TracBrowser
for help on using the repository browser.