turbaszek commented on a change in pull request #9280:
URL: https://github.com/apache/airflow/pull/9280#discussion_r446074371



##########
File path: tests/hooks/test_hive_hook.py
##########
@@ -390,6 +390,11 @@ def test_table_exists(self):
             self.hook.table_exists(str(random.randint(1, 10000)))
         )
 
+    @mock.patch('random.shuffle')
+    def test_check_hms_clients_load_balance(self, mock_shuffle):
+        HiveMetastoreHook()._find_valid_server()
+        mock_shuffle.has_calls()
+

Review comment:
       ```suggestion
       @mock.patch('airflow.hooks.hive_hooks.random.shuffle')
       @mock.patch('airflow.hooks.hive_hooks. 
HiveMetastoreHook.get_connections')
       def test_check_hms_clients_load_balance(self, mock_get_conn, 
mock_shuffle):
           HiveMetastoreHook()._find_valid_server()
           mock_shuffle.assert_called_once_with(mock_get_conn.return_value)
   
   ```
   WDYT?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to