Coverage for mindsdb / integrations / handlers / couchbase_handler / tests / test_couchbase_handler.py: 0%

22 statements  

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

1import unittest 

2 

3from mindsdb.integrations.handlers.couchbase_handler.couchbase_handler import ( 

4 CouchbaseHandler, 

5) 

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

7 

8 

9class CouchbaseHandlerTest(unittest.TestCase): 

10 @classmethod 

11 def setUpClass(cls): 

12 connection_data = { 

13 "host": "192.168.33.10", 

14 "user": "admin", 

15 "password": "00154abs", 

16 "bucket": "bag-bucket", 

17 "scope": "test-scope", # This is optinal, but if ommited will default to _default. 

18 } 

19 cls.kwargs = dict(connection_data=connection_data) 

20 cls.handler = CouchbaseHandler("test_couchbase_handler", **cls.kwargs) 

21 

22 def test_0_connect(self): 

23 self.handler.check_connection() 

24 

25 def test_1_get_tables(self): 

26 tbls = self.handler.get_tables() 

27 assert tbls.type is not RESPONSE_TYPE.ERROR 

28 

29 def test_2_get_column(self): 

30 tbls = self.handler.get_columns("onsale") 

31 assert tbls.type is not RESPONSE_TYPE.ERROR 

32 

33 def test_3_native_query_select(self): 

34 tbls = self.handler.native_query("SELECT * FROM onsale") 

35 assert tbls.type is not RESPONSE_TYPE.ERROR 

36 

37 

38if __name__ == "__main__": 

39 unittest.main()