@@ -1494,6 +1494,30 @@ def test_label_added_for_unrelated_component(self):
14941494 self .assertIn ('D' , self .issue .components )
14951495 self .assertIn ('Test-Predator-Auto-Components' , self .issue .labels )
14961496
1497+ def test_vrp_security_upload_overrides_bug_type_and_components (self ):
1498+ """Ensure that the type and component gets reset for a processed VRP direct
1499+ uploaded security bug. This test is specific to the Google Issue Tracker."""
1500+ self .testcase .security_flag = True
1501+ self .testcase .put ()
1502+ setattr (self .issue , 'component_id' , cleanup .VRP_UPLOAD_COMPONENT_ID )
1503+
1504+ cleanup .update_component_labels_and_id (
1505+ policy = self .policy , testcase = self .testcase , issue = self .issue )
1506+ self .assertIn ('Type-VULNERABILITY' , self .issue .labels )
1507+ self .assertEqual (cleanup .CHROMIUM_COMPONENT_ID , self .issue .component_id )
1508+
1509+ def test_vrp_non_security_upload_overrides_bug_type_and_components (self ):
1510+ """Ensure that the type and component gets reset for a processed VRP direct
1511+ uploaded non-security bug. This test is specific to the Google Issue Tracker."""
1512+ self .testcase .security_flag = False
1513+ self .testcase .put ()
1514+ setattr (self .issue , 'component_id' , cleanup .VRP_UPLOAD_COMPONENT_ID )
1515+
1516+ cleanup .update_component_labels_and_id (
1517+ policy = self .policy , testcase = self .testcase , issue = self .issue )
1518+ self .assertIn ('Type-BUG' , self .issue .labels )
1519+ self .assertEqual (cleanup .CHROMIUM_COMPONENT_ID , self .issue .component_id )
1520+
14971521
14981522@test_utils .with_cloud_emulators ('datastore' )
14991523class UpdateIssueCCsFromOwnersFileTest (unittest .TestCase ):
0 commit comments