Coverage for mindsdb / integrations / handlers / informix_handler / tests / test_informix_handler.py: 0%

30 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-21 00:36 +0000

1import unittest 

2from mindsdb.integrations.handlers.informix_handler.informix_handler import ( 

3 InformixHandler, 

4) 

5from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE 

6 

7 

8class InformixHandlerTest(unittest.TestCase): 

9 @classmethod 

10 def setUpClass(cls): 

11 cls.kwargs = { 

12 "connection_data": { 

13 "server": "server", 

14 "host": "127.0.0.1", 

15 "port": 9093, 

16 "user": "informix", 

17 "password": "in4mix", 

18 "database": "demo", 

19 "schema_name": "love", 

20 "loging_enabled": False, 

21 } 

22 } 

23 cls.handler = InformixHandler("test_informix_handler", cls.kwargs) 

24 

25 def test_0_connect(self): 

26 self.handler.connect() 

27 

28 def test_1_drop_table(self): 

29 res = self.handler.query("DROP TABLE IF EXISTS LOVE;") 

30 assert res.type is not RESPONSE_TYPE.ERROR 

31 

32 def test_2_create_table(self): 

33 res = self.handler.query("CREATE TABLE IF NOT EXISTS LOVE (LOVER varchar(20));") 

34 assert res.type is not RESPONSE_TYPE.ERROR 

35 

36 def test_3_insert(self): 

37 res = self.handler.query("INSERT INTO LOVE VALUES('Hari');") 

38 assert res.type is not RESPONSE_TYPE.ERROR 

39 

40 def test_4_get_tables(self): 

41 tables = self.handler.get_tables() 

42 assert tables.type is RESPONSE_TYPE.TABLE 

43 

44 def test_5_select_query(self): 

45 query = "SELECT * FROM LOVE;" 

46 result = self.handler.native_query(query) 

47 assert result.type is RESPONSE_TYPE.TABLE 

48 

49 def test_5_check_connection(self): 

50 self.handler.check_connection() 

51 

52 

53if __name__ == "__main__": 

54 unittest.main()