tools/metrics/histograms/expand_owners_unittest.py
def testExpandOwnersWithoutValidPrimaryOwner_TeamEmail(self):
    """Checks that an error is raised when the primary owner is a team.

    A valid primary owner is an individual's email address, e.g. rae@google.com,
    sam@chromium.org, or the owner placeholder.
    """
    histograms_without_valid_first_owner = xml.dom.minidom.parseString("""
<histograms>

<histogram name="Caffeination" units="mg">
  <owner>coffee-team@google.com</owner>
  <summary>I like coffee.</summary>
</histogram>

</histograms>
""")

    with self.assertRaisesRegexp(
        expand_owners.Error,
        'The histogram Caffeination must have a valid primary owner, i.e. a '
        'Googler with an @google.com or @chromium.org email address.'):
      expand_owners.ExpandHistogramsOWNERS(histograms_without_valid_first_owner)
Checks that an error is raised when the primary owner is a team.

    A valid primary owner is an individual's email address, e.g. rae@google.com,
    sam@chromium.org, or the owner placeholder.
    
Checks that an error is raised when the primary owner is a team.
A valid primary owner is an individual's email address, e.g.
Checks that an error is raised when the primary owner is a team . A valid primary owner is an individual ' s email address e . g .
def testExpandOwnersWithoutValidPrimaryOwner_TeamEmail(self):
    histograms_without_valid_first_owner = xml.dom.minidom.parseString("""
<histograms>
<histogram name="Caffeination" units="mg">
  <owner>coffee-team@google.com</owner>
  <summary>I like coffee.</summary>
</histogram>
</histograms>
""")
    with self.assertRaisesRegexp(
        expand_owners.Error,
        'The histogram Caffeination must have a valid primary owner, i.e. a '
        'Googler with an @google.com or @chromium.org email address.'):
      expand_owners.ExpandHistogramsOWNERS(histograms_without_valid_first_owner)
def testExpandOwnersWithoutValidPrimaryOwner_TeamEmail ( self ) : histograms_without_valid_first_owner = xml . dom . minidom . parseString ( """
<histograms>

<histogram name="Caffeination" units="mg">
  <owner>coffee-team@google.com</owner>
  <summary>I like coffee.</summary>
</histogram>

</histograms>
""" ) with self . assertRaisesRegexp ( expand_owners . Error , 'The histogram Caffeination must have a valid primary owner, i.e. a ' 'Googler with an @google.com or @chromium.org email address.' ) : expand_owners . ExpandHistogramsOWNERS ( histograms_without_valid_first_owner )
Checks that an error is raised when the primary owner is a team.
Checks that an error is raised when the primary owner is a team .
"""Checks that an error is raised when the primary owner is a team.

    A valid primary owner is an individual's email address, e.g. rae@google.com,
    sam@chromium.org, or the owner placeholder.
    """
self