Coverage for mindsdb / integrations / handlers / altibase_handler / tests / test_altibase_handler_dsn.py: 0%

34 statements  

« 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 

4 

5 

6class AltibaseHandlerTest(unittest.TestCase): 

7 @classmethod 

8 def setUpClass(cls): 

9 cls.kwargs = { 

10 "connection_data": { 

11 "dsn": "altiodbc", 

12 # Override 

13 # "host": "127.0.0.1", 

14 # "port": 20300, 

15 # "user": "sys", 

16 # "password": "manager" 

17 } 

18 } 

19 cls.handler = AltibaseHandler('test_altibase_handler', **cls.kwargs) 

20 

21 def test_0_connect(self): 

22 assert self.handler.connect() 

23 

24 def test_1_drop_table(self): 

25 # Not supported 'IF EXISTS' syntax 

26 res = self.handler.query("DROP TABLE TEST_TABLE") 

27 assert res.type is RESPONSE_TYPE.OK 

28 

29 def test_2_create_table(self): 

30 res = self.handler.query( 

31 '''CREATE TABLE TEST_TABLE ( 

32 ID INT PRIMARY KEY, 

33 NAME VARCHAR(14) 

34 )''' 

35 ) 

36 assert res.type is RESPONSE_TYPE.OK 

37 

38 def test_3_insert(self): 

39 res = self.handler.query( 

40 """INSERT INTO TEST_TABLE 

41 VALUES 

42 (100,'ONE HUNDRED'), 

43 (200,'TWO HUNDRED'), 

44 (300,'THREE HUNDRED')""" 

45 ) 

46 assert res.type is RESPONSE_TYPE.OK 

47 

48 def test_4_select(self): 

49 res = self.handler.query('SELECT * FROM TEST_TABLE') 

50 assert res.type is RESPONSE_TYPE.TABLE 

51 

52 def test_5_check_connection(self): 

53 assert self.handler.check_connection() 

54 

55 def test_6_get_tables(self): 

56 res = self.handler.get_tables() 

57 assert res.type is RESPONSE_TYPE.TABLE 

58 

59 def test_7_get_columns(self): 

60 res = self.handler.get_columns("TEST_TABLE") 

61 assert res.type is RESPONSE_TYPE.TABLE 

62 

63 def test_8_disconnect(self): 

64 assert self.handler.disconnect() 

65 

66 

67if __name__ == '__main__': 

68 unittest.main()