Coverage for mindsdb / integrations / handlers / questdb_handler / tests / test_questdb_handler.py: 0%

20 statements  

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

1import unittest 

2from mindsdb.integrations.handlers.questdb_handler.questdb_handler import QuestDBHandler 

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

4 

5 

6class QuestDBHandlerTest(unittest.TestCase): 

7 @classmethod 

8 def setUpClass(cls): 

9 cls.kwargs = { 

10 "connection_data": { 

11 "host": "127.0.0.1", 

12 "port": "8812", 

13 "user": "admin", 

14 "password": "quest", 

15 "database": "questdb" 

16 } 

17 } 

18 cls.handler = QuestDBHandler('test_questdb_handler', **cls.kwargs) 

19 

20 def test_0_check_connection(self): 

21 assert self.handler.check_connection() 

22 

23 def test_1_describe_table(self): 

24 described = self.handler.describe_table("house_rentals_data") 

25 assert described['type'] is not RESPONSE_TYPE.ERROR 

26 

27 def test_2_get_tables(self): 

28 tables = self.handler.get_tables() 

29 assert tables['type'] is not RESPONSE_TYPE.ERROR 

30 

31 def test_3_select_query(self): 

32 query = "SELECT * FROM house_rentals_data WHERE 'id'='1'" 

33 result = self.handler.query(query) 

34 assert len(result) > 0