def test_check_for_directory(self, mock_service): mock_instance = mock_service.return_value mock_instance.exists.return_value = True hook = AzureFileShareHook(wasb_conn_id='wasb_test_sas_token') assert hook.check_for_directory('share', 'directory', timeout=3) mock_instance.exists.assert_called_once_with('share', 'directory', timeout=3)
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