tools/metrics/histograms/expand_owners_unittest.py
def testExpandOwnersWithFakeFilePath(self):
    """Checks that an error is raised with a fake OWNERS file path."""
    histograms_with_fake_file_path = xml.dom.minidom.parseString("""
<histograms>

<histogram name="Caffeination" units="mg">
  <owner>joe@chromium.org</owner>
  <owner>src/medium/medium/roast/OWNERS</owner>
  <summary>I like coffee.</summary>
</histogram>

</histograms>
""")

    with self.assertRaisesRegexp(
        expand_owners.Error, r'The file at .*medium.*OWNERS does not exist\.'):
      expand_owners.ExpandHistogramsOWNERS(histograms_with_fake_file_path)
Checks that an error is raised with a fake OWNERS file path.
Checks that an error is raised with a fake OWNERS file path.
Checks that an error is raised with a fake OWNERS file path .
def testExpandOwnersWithFakeFilePath(self):
    histograms_with_fake_file_path = xml.dom.minidom.parseString("""
<histograms>
<histogram name="Caffeination" units="mg">
  <owner>joe@chromium.org</owner>
  <owner>src/medium/medium/roast/OWNERS</owner>
  <summary>I like coffee.</summary>
</histogram>
</histograms>
""")
    with self.assertRaisesRegexp(
        expand_owners.Error, r'The file at .*medium.*OWNERS does not exist\.'):
      expand_owners.ExpandHistogramsOWNERS(histograms_with_fake_file_path)
def testExpandOwnersWithFakeFilePath ( self ) : histograms_with_fake_file_path = xml . dom . minidom . parseString ( """
<histograms>

<histogram name="Caffeination" units="mg">
  <owner>joe@chromium.org</owner>
  <owner>src/medium/medium/roast/OWNERS</owner>
  <summary>I like coffee.</summary>
</histogram>

</histograms>
""" ) with self . assertRaisesRegexp ( expand_owners . Error , r'The file at .*medium.*OWNERS does not exist\.' ) : expand_owners . ExpandHistogramsOWNERS ( histograms_with_fake_file_path )
Checks that an error is raised with a fake OWNERS file path.
Checks that an error is raised with a fake OWNERS file path .
"""Checks that an error is raised with a fake OWNERS file path."""
self