Пример #1
0
 def testRemoveBugLabel(self):
     bug_label_patterns.AddBugLabelPattern('foo', '*/*/foo')
     bug_label_patterns.AddBugLabelPattern('bar', '*/*/bar')
     bug_label_patterns.AddBugLabelPattern('bar', '*/*/bar-extra')
     bug_label_patterns.RemoveBugLabel('bar')
     self.assertEqual({'foo': ['*/*/foo']},
                      bug_label_patterns.GetBugLabelPatterns())
Пример #2
0
    def _RemoveBuglabelPattern(self):
        """Removes a BugLabelPattern so that the label no longer applies.

    Request parameters:
      buglabel_to_remove: The bug label, which is the name of a
      BugLabelPattern entity.
    """
        label = self.request.get('buglabel_to_remove')
        bug_label_patterns.RemoveBugLabel(label)
        self.RenderHtml('result.html',
                        {'headline': 'Deleted label %s' % label})
 def testRemoveBugLabel_DoesntExist_NoError(self):
   bug_label_patterns.RemoveBugLabel('bar')
   self.assertEqual({}, bug_label_patterns.GetBugLabelPatterns())