Coverage for mindsdb / integrations / handlers / derby_handler / tests / test_derby_handler.py: 0%

29 statements  

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

1import unittest 

2from mindsdb.integrations.handlers.derby_handler.derby_handler import DerbyHandler 

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

4 

5 

6class DerbyHandlerTest(unittest.TestCase): 

7 @classmethod 

8 def setUpClass(cls): 

9 cls.kwargs = { 

10 "connection_data": { 

11 "host": "localhost", 

12 "port": "1527", 

13 "database": "seconddb", 

14 } 

15 } 

16 cls.handler = DerbyHandler('test_derby_handler', **cls.kwargs) 

17 

18 def test_0_connect(self): 

19 self.handler.connect() 

20 

21 def test_1_check_connection(self): 

22 self.handler.check_connection() 

23 

24 def test_2_create(self): 

25 res = self.handler.query('CREATE TABLE TESTTABLEX (ID INT PRIMARY KEY, NAME VARCHAR(14))') 

26 assert res.type is RESPONSE_TYPE.OK 

27 

28 def test_3_insert(self): 

29 res = self.handler.query("INSERT INTO TESTTABLEX VALUES (100,'ONE HUNDRED'),(200,'TWO HUNDRED'),(300,'THREE HUNDRED')") 

30 assert res.type is RESPONSE_TYPE.OK 

31 

32 def test_4_select(self): 

33 res = self.handler.query('SELECT * FROM TESTTABLEX') 

34 assert res.type is RESPONSE_TYPE.TABLE 

35 

36 def test_5_get_tables(self): 

37 res = self.handler.get_tables() 

38 assert res.type is RESPONSE_TYPE.TABLE 

39 

40 def test_6_get_columns(self): 

41 res = self.handler.get_columns("TESTTABLEX") 

42 assert res.type is RESPONSE_TYPE.TABLE 

43 

44 

45if __name__ == '__main__': 

46 unittest.main()