Coverage for mindsdb / integrations / handlers / datastax_handler / tests / test_cassandra_handler.py: 0%
23 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.api.executor.data_types.response_type import RESPONSE_TYPE
3from mindsdb.integrations.handlers.datastax_handler.datastax_handler import (
4 DatastaxHandler,
5)
8class DatastaxHandlerTest(unittest.TestCase):
9 @classmethod
10 def setUpClass(cls):
11 cls.kwargs = {
12 "connection_data": {
13 "user": "cassandra",
14 "password": "",
15 "secure_connect_bundle": "/home/Downloads/file.zip",
16 }
17 }
18 cls.handler = DatastaxHandler("test_datastax_handler", **cls.kwargs)
20 def test_0_connect(self):
21 self.handler.check_connection()
23 def test_1_native_query_show_keyspaces(self):
24 dbs = self.handler.native_query("DESC KEYSPACES;")
25 assert dbs.type is not RESPONSE_TYPE.ERROR
27 def test_2_get_tables(self):
28 tbls = self.handler.get_tables()
29 assert tbls.type is not RESPONSE_TYPE.ERROR
31 def test_3_describe_table(self):
32 described = self.handler.get_columns("home_rentals")
33 assert described.type is RESPONSE_TYPE.TABLE
35 def test_4_select_query(self):
36 query = "SELECT * FROM home_rentals WHERE 'id'='3712'"
37 result = self.handler.query(query)
38 assert result.type is RESPONSE_TYPE.TABLE