def test_create_directory(self, mock_service): mock_instance = mock_service.return_value hook = AzureFileShareHook(wasb_conn_id='wasb_test_sas_token') hook.create_directory('share', 'directory', timeout=1) mock_instance.create_directory.assert_called_once_with('share', 'directory', timeout=1)
def create_fileshare(): """Create a fileshare with directory""" hook = AzureFileShareHook() hook.create_share(NAME) hook.create_directory(share_name=NAME, directory_name=DIRECTORY) exists = hook.check_for_directory(share_name=NAME, directory_name=DIRECTORY) if not exists: raise Exception
def create_directory(cls, share_name: str, wasb_conn_id: str, directory: str): hook = AzureFileShareHook(wasb_conn_id=wasb_conn_id) hook.create_directory(share_name=share_name, directory_name=directory)