michalslowikowski00 commented on a change in pull request #10991:
URL: https://github.com/apache/airflow/pull/10991#discussion_r494948161



##########
File path: tests/providers/microsoft/azure/hooks/test_azure_fileshare.py
##########
@@ -112,6 +113,20 @@ def test_list_directories_and_files(self, mock_service):
         hook.list_directories_and_files('share', 'directory', timeout=1)
         
mock_instance.list_directories_and_files.assert_called_once_with('share', 
'directory', timeout=1)
 
+    
@mock.patch('airflow.providers.microsoft.azure.hooks.azure_fileshare.FileService',
 autospec=True)
+    def test_list_files(self, mock_service):
+        mock_instance = mock_service.return_value
+        mock_instance.list_directories_and_files.return_value = [
+            File("file1"),
+            File("file2"),
+            Directory("dir1"),
+            Directory("dir2"),
+        ]
+        hook = AzureFileShareHook(wasb_conn_id='wasb_test_sas_token')
+        files = hook.list_files('share', 'directory', timeout=1)

Review comment:
       Should it be a mock also? I mean the `AzureFileShareHook` object. 
   I think right now the real api call is make.




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