예제 #1
0
 def test_load_string(self, mock_service):
     mock_instance = mock_service.return_value
     hook = AzureFileShareHook(wasb_conn_id='wasb_test_sas_token')
     hook.load_string('big string', 'share', 'directory', 'file', timeout=1)
     mock_instance.create_file_from_text.assert_called_once_with(
         'share', 'directory', 'file', 'big string', timeout=1
     )
예제 #2
0
 def upload_file_from_string(cls,
                             string_data: str,
                             share_name: str,
                             wasb_conn_id: str,
                             file_name: str,
                             directory: Optional[str] = None):
     hook = AzureFileShareHook(wasb_conn_id=wasb_conn_id)
     hook.load_string(
         string_data=string_data,
         share_name=share_name,
         directory_name=directory,
         file_name=file_name,
     )