def Update(config, active_master, c):
  c['status'].append(chromium_notifier.ChromiumNotifier(
      fromaddr=active_master.from_address,
      categories_steps=gardener_categories_steps,
      exclusions=exclusions,
      relayhost=config.Master.smtp,
      subject='buildbot %(result)s in %(projectName)s on %(builder)s, '
              'revision %(revision)s',
      status_header=warning_header,
      extraRecipients=active_master.tree_closing_notification_recipients,
      lookup=master_utils.FilterDomain(),
      forgiving_steps=forgiving_steps,
      public_html='../master.chromiumos/public_html',
      sheriffs=['sheriff_cr_cros_gardeners'],
      use_getname=True))
  c['status'].append(chromium_notifier.ChromiumNotifier(
      fromaddr=active_master.from_address,
      categories_steps=memory_categories_steps,
      exclusions=exclusions,
      relayhost=config.Master.smtp,
      subject='buildbot %(result)s in %(projectName)s on %(builder)s, '
              'revision %(revision)s',
      status_header=warning_header,
      extraRecipients=active_master.tree_closing_notification_recipients,
      lookup=master_utils.FilterDomain(),
      forgiving_steps=forgiving_steps,
      public_html='../master.chromiumos/public_html',
      sheriffs=['sheriff_memory'],
      use_getname=True))
 def testChromiumNotifierDecoration(self):
     notifier = chromium_notifier.ChromiumNotifier(
         fromaddr='buildbot@test',
         mode='failing',
         forgiving_steps=[],
         lookup='test',
         sendToInterestedUsers=False,
         extraRecipients=['extra@test'],
         status_header='Failure on test.')
     self.assertEquals(notifier.getGenericName("foo"), "foo")
     self.assertEquals(notifier.getGenericName("foo "), "foo")
     self.assertEquals(notifier.getGenericName(" foo"), "foo")
     self.assertEquals(notifier.getGenericName("foo [bar]"), "foo")
     self.assertEquals(notifier.getGenericName(" foo [bar]"), "foo")
     self.assertEquals(notifier.getGenericName("f [u] [bar]"), "f [u]")
     self.assertEquals(notifier.getGenericName("foo[bar]"), "foo")
     self.assertEquals(notifier.getGenericName("[foobar]"), "[foobar]")
     self.assertEquals(notifier.getGenericName(" [foobar]"), "[foobar]")
     self.assertEquals(notifier.getGenericName(" [foobar] "), "[foobar]")
     self.assertEquals(notifier.getGenericName("[foobar] [foo]"),
                       "[foobar]")
     self.assertEquals(notifier.getGenericName("apple ]["), "apple ][")
     self.assertEquals(notifier.getGenericName("ipad ][][]["),
                       "ipad ][][][")
     self.assertEquals(notifier.getGenericName("ipad [][]"), "ipad []")
     self.assertEquals(notifier.getGenericName("box []"), "box")
 def testChromiumNotifierCreation(self):
     notifier = chromium_notifier.ChromiumNotifier(
         fromaddr='buildbot@test',
         mode='failing',
         forgiving_steps=[],
         lookup='test',
         sendToInterestedUsers=False,
         extraRecipients=['extra@test'],
         status_header='Failure on test.')
     self.assertTrue(notifier)
 def testChromiumNotifierWildcardNoBuilderMatch(self):
     notifier = chromium_notifier.ChromiumNotifier(
         fromaddr='buildbot@test',
         mode='failing',
         categories_steps={'foobar': '*'},
         forgiving_steps=[],
         lookup='test',
         sendToInterestedUsers=False,
         extraRecipients=['extra@test'],
         use_getname=True,
         status_header='Failure on test.')
     self.assertTrue(notifier)
     builder_status = mock.Mock()
     builder_status.getName.return_value = 'foo'
     builder_status.category = 'foo|test'
     build_status = mock.Mock()
     build_status.getBuilder.return_value = builder_status
     step_status = mock.Mock()
     step_status.getName.return_value = 'bar'
     results = [FAILURE]
     notifier.buildMessage = mock.Mock()
     notifier.buildMessage.return_value = True
     retval = notifier.stepFinished(build_status, step_status, results)
     self.assertEquals(retval, None)