kevinjqliu commented on code in PR #752: URL: https://github.com/apache/iceberg-python/pull/752#discussion_r1713023562
########## tests/catalog/test_hive.py: ########## @@ -1195,3 +1195,40 @@ def test_hive_wait_for_lock() -> None: with pytest.raises(WaitingForLockException): catalog._wait_for_lock("db", "tbl", lockid, catalog._client) assert catalog._client.check_lock.call_count == 5 + +def test_create_hive_client_success(): + properties = { + "uri": "thrift://localhost:10000", + "ugi": "user" + } + + with patch('pyiceberg.catalog.hive._HiveClient', return_value=MagicMock()) as mock_hive_client: + client = HiveCatalog._create_hive_client(properties) + mock_hive_client.assert_called_once_with("thrift://localhost:10000", "user") + assert client is not None + +def test_create_hive_client_multiple_uris(): + properties = { + "uri": "thrift://localhost:10000,thrift://localhost:10001", + "ugi": "user" + } + + with patch('pyiceberg.catalog.hive._HiveClient') as mock_hive_client: + mock_hive_client.side_effect = [Exception("Connection failed"), MagicMock()] Review Comment: thanks! i think that should cover all the cases -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org