Coverage for mindsdb / integrations / handlers / cloud_sql_handler / tests / test_cloud_sql_mssql_handler.py: 0%

22 statements  

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

1import unittest 

2from mindsdb.integrations.handlers.cloud_sql_handler.cloud_sql_handler import CloudSQLHandler 

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

4 

5 

6class CloudSQLMSSQLHandlerTest(unittest.TestCase): 

7 @classmethod 

8 def setUpClass(cls): 

9 cls.kwargs = { 

10 "host": "", 

11 "port": 1433, 

12 "user": "root", 

13 "password": "", 

14 "database": "public", 

15 "db_engine": "mssql" 

16 } 

17 cls.handler = CloudSQLHandler('test_cloud_sql_mssql_handler', cls.kwargs) 

18 

19 def test_0_check_connection(self): 

20 assert self.handler.check_connection() 

21 

22 def test_1_native_query_select(self): 

23 query = "SELECT * FROM person" 

24 result = self.handler.native_query(query) 

25 assert result.type is RESPONSE_TYPE.TABLE 

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_get_columns(self): 

32 columns = self.handler.get_columns('person') 

33 assert columns.type is not RESPONSE_TYPE.ERROR 

34 

35 

36if __name__ == '__main__': 

37 unittest.main()