Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
singlestore-labs
GitHub Repository: singlestore-labs/singlestoredb-python
Path: blob/main/singlestoredb/mysql/tests/test_err.py
469 views
1
# type: ignore
2
import unittest
3
4
from singlestoredb.mysql import err
5
6
7
__all__ = ['TestRaiseException']
8
9
10
class TestRaiseException(unittest.TestCase):
11
12
def test_raise_mysql_exception(self):
13
data = b'\xff\x15\x04#28000Access denied'
14
with self.assertRaises(err.OperationalError) as cm:
15
err.raise_mysql_exception(data)
16
self.assertEqual(cm.exception.args, (1045, 'Access denied', None))
17
18