Coverage for mindsdb / integrations / handlers / altibase_handler / tests / test_altibase_handler.py: 0%
34 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.altibase_handler.altibase_handler import AltibaseHandler
3from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
6class AltibaseHandlerTest(unittest.TestCase):
7 @classmethod
8 def setUpClass(cls):
9 cls.kwargs = {
10 "connection_data": {
11 "host": "127.0.0.1",
12 "port": 20300,
13 "database": "mydb",
14 "user": "sys",
15 "password": "manager"
16 }
17 }
18 cls.handler = AltibaseHandler('test_altibase_handler', **cls.kwargs)
20 def test_0_connect(self):
21 assert self.handler.connect()
23 def test_1_drop_table(self):
24 # Not supported 'IF EXISTS' syntax
25 res = self.handler.query("DROP TABLE TEST_TABLE")
26 assert res.type is RESPONSE_TYPE.OK
28 def test_2_create_table(self):
29 res = self.handler.query(
30 '''CREATE TABLE TEST_TABLE (
31 ID INT PRIMARY KEY,
32 NAME VARCHAR(14)
33 )'''
34 )
35 assert res.type is RESPONSE_TYPE.OK
37 def test_3_insert(self):
38 res = self.handler.query(
39 """INSERT INTO TEST_TABLE
40 VALUES
41 (100,'ONE HUNDRED'),
42 (200,'TWO HUNDRED'),
43 (300,'THREE HUNDRED')"""
44 )
45 assert res.type is RESPONSE_TYPE.OK
47 def test_4_select(self):
48 res = self.handler.query('SELECT * FROM TEST_TABLE')
49 assert res.type is RESPONSE_TYPE.TABLE
51 def test_5_check_connection(self):
52 assert self.handler.check_connection()
54 def test_6_get_tables(self):
55 res = self.handler.get_tables()
56 assert res.type is RESPONSE_TYPE.TABLE
58 def test_7_get_columns(self):
59 res = self.handler.get_columns("TEST_TABLE")
60 assert res.type is RESPONSE_TYPE.TABLE
62 def test_8_disconnect(self):
63 assert self.handler.disconnect()
66if __name__ == '__main__':
67 unittest.main()