Coverage for mindsdb / integrations / handlers / druid_handler / tests / test_druid_handler.py: 0%
22 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.druid_handler.druid_handler import DruidHandler
3from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
6class DruidHandlerTest(unittest.TestCase):
7 @classmethod
8 def setUpClass(cls):
9 cls.kwargs = {
10 "host": "localhost",
11 "port": 8888,
12 "path": "/druid/v2/sql/",
13 "scheme": "http"
14 }
15 cls.handler = DruidHandler('test_druid_handler', cls.kwargs)
17 def test_0_check_connection(self):
18 assert self.handler.check_connection()
20 def test_1_native_query_select(self):
21 query = "SELECT * FROM wikipedia"
22 result = self.handler.native_query(query)
23 assert result.type is RESPONSE_TYPE.TABLE
25 def test_2_get_tables(self):
26 tables = self.handler.get_tables()
27 assert tables.type is not RESPONSE_TYPE.ERROR
29 def test_3_get_columns(self):
30 columns = self.handler.get_columns('wikipedia')
31 assert columns.type is not RESPONSE_TYPE.ERROR
34if __name__ == '__main__':
35 unittest.main()