Coverage for mindsdb / integrations / handlers / opengauss_handler / tests / test_opengauss_handler.py: 0%
28 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-21 00:36 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-21 00:36 +0000
1import unittest
2from mindsdb.integrations.handlers.opengauss_handler.opengauss_handler import OpenGaussHandler
5class OpenGaussHandlerTest(unittest.TestCase):
6 @classmethod
7 def setUpClass(cls):
8 cls.kwargs = {
9 "host": "localhost",
10 "port": "5432",
11 "user": "mindsdb",
12 "password": "mindsdb",
13 "database": "test",
14 "ssl": False
15 }
16 cls.handler = OpenGaussHandler('test_opengauss_handler', **cls.kwargs)
18 def test_0_connect(self):
19 self.handler.connect()
21 def test_1_check_connection(self):
22 assert self.handler.check_connection()
24 def test_2_native_query_show_dbs(self):
25 dbs = self.handler.native_query("SHOW DATABASES;")
26 assert isinstance(dbs, list)
28 def test_3_get_tables(self):
29 tbls = self.handler.get_tables()
30 assert isinstance(tbls, list)
32 def test_5_create_table(self):
33 try:
34 self.handler.native_query("CREATE TABLE test_opengauss (test_col INTEGER)")
35 except Exception:
36 pass
38 def test_6_describe_table(self):
39 described = self.handler.get_columns("dt_test")
40 assert isinstance(described, list)
42 def test_7_select_query(self):
43 query = "SELECT * FROM dt_test WHERE 'id'='a'"
44 self.handler.native_query(query)