@@ -284,29 +284,18 @@ describe('Model Armor tests', () => {
284284 `projects/${ projectId } /locations/${ locationId } /templates/${ emptyTemplateId } ` ,
285285 `projects/${ projectId } /locations/${ locationId } /templates/${ basicTemplateId } ` ,
286286 `projects/${ projectId } /locations/${ locationId } /templates/${ basicSdpTemplateId } ` ,
287- `projects/${ projectId } /locations/${ locationId } /templates/${ allFilterTemplateId } ` ,
288287 `projects/${ projectId } /locations/${ locationId } /templates/${ advanceSdpTemplateId } ` ,
288+ `projects/${ projectId } /locations/${ locationId } /templates/${ allFilterTemplateId } ` ,
289289 `projects/${ projectId } /locations/${ locationId } /templates/${ templateToDeleteId } `
290290 ) ;
291291 } ) ;
292292
293293 after ( async ( ) => {
294- // Clean up all templates
295- const directTemplates = [ emptyTemplateId , basicTemplateId ] ;
296- for ( const templateId of directTemplates ) {
297- await deleteTemplate (
298- `projects/${ projectId } /locations/${ locationId } /templates/${ templateId } `
299- ) ;
300- }
301-
302294 for ( const templateName of templatesToDelete ) {
303- try {
304- await client . deleteTemplate ( { name : templateName } ) ;
305- console . log ( `Cleaned up template: ${ templateName } ` ) ;
306- } catch ( error ) {
307- console . error ( `Failed to delete template ${ templateName } :` , error ) ;
308- }
295+ await deleteTemplate ( templateName ) ;
309296 }
297+
298+ await deleteDlpTemplates ( ) ;
310299 } ) ;
311300
312301 // =================== Template Creation Tests ===================
@@ -536,11 +525,6 @@ describe('Model Armor tests', () => {
536525 const piSettings = response . filterConfig . piAndJailbreakFilterSettings ;
537526 assert . strictEqual ( piSettings . filterEnforcement , 'ENABLED' ) ;
538527 assert . strictEqual ( piSettings . confidenceLevel , 'LOW_AND_ABOVE' ) ;
539- for ( const templateName of templatesToDelete ) {
540- await deleteTemplate ( templateName ) ;
541- }
542-
543- await deleteDlpTemplates ( ) ;
544528 } ) ;
545529
546530 // =================== Quickstart Tests ===================
0 commit comments