test_azure_fileshare_14.py 580 B

123456789101112
  1. def test_list_files(self, mock_service):
  2. mock_instance = mock_service.return_value
  3. mock_instance.list_directories_and_files.return_value = [
  4. File("file1"),
  5. File("file2"),
  6. Directory("dir1"),
  7. Directory("dir2"),
  8. ]
  9. hook = AzureFileShareHook(azure_fileshare_conn_id='azure_fileshare_extras')
  10. files = hook.list_files('share', 'directory', timeout=1)
  11. assert files == ["file1", 'file2']
  12. mock_instance.list_directories_and_files.assert_called_once_with('share', 'directory', timeout=1)