tools/metrics/histograms/expand_owners_unittest.py
def testExpandOwnersWithSameOwners(self):
    """
    Checks that no error is raised when all owners in a file are already in
    <owner> elements.
    """
    absolute_path = _MakeOwnersFile('same_OWNERS', self.temp_dir)
    src_relative_path = _GetSrcRelativePath(absolute_path)

    with open(absolute_path, 'w') as owners_file:
      owners_file.write(
          'joe@chromium.org')  # Write to the file so that it exists.

    histograms_string = xml.dom.minidom.parseString("""
<histograms>

<histogram name="Caffeination" units="mg">
  <owner>joe@chromium.org</owner>
  <owner>{}</owner>
  <summary>I like coffee.</summary>
</histogram>

</histograms>
""".format(src_relative_path))

    self.assertIsNone(expand_owners.ExpandHistogramsOWNERS(histograms_string))

    Checks that no error is raised when all owners in a file are already in
    <owner> elements.
    
Checks that no error is raised when all owners in a file are already in
 elements.
Checks that no error is raised when all owners in a file are already in elements .
def testExpandOwnersWithSameOwners(self):
    absolute_path = _MakeOwnersFile('same_OWNERS', self.temp_dir)
    src_relative_path = _GetSrcRelativePath(absolute_path)
    with open(absolute_path, 'w') as owners_file:
      owners_file.write(
          'joe@chromium.org')  
    histograms_string = xml.dom.minidom.parseString("""
<histograms>
<histogram name="Caffeination" units="mg">
  <owner>joe@chromium.org</owner>
  <owner>{}</owner>
  <summary>I like coffee.</summary>
</histogram>
</histograms>
""".format(src_relative_path))
    self.assertIsNone(expand_owners.ExpandHistogramsOWNERS(histograms_string))
def testExpandOwnersWithSameOwners ( self ) : absolute_path = _MakeOwnersFile ( 'same_OWNERS' , self . temp_dir ) src_relative_path = _GetSrcRelativePath ( absolute_path ) with open ( absolute_path , 'w' ) as owners_file : owners_file . write ( 'joe@chromium.org' ) histograms_string = xml . dom . minidom . parseString ( """
<histograms>

<histogram name="Caffeination" units="mg">
  <owner>joe@chromium.org</owner>
  <owner>{}</owner>
  <summary>I like coffee.</summary>
</histogram>

</histograms>
""" . format ( src_relative_path ) ) self . assertIsNone ( expand_owners . ExpandHistogramsOWNERS ( histograms_string ) )
Checks that no error is raised when all owners in a file are already in
<owner> elements.
Checks that no error is raised when all owners in a file are already in <owner > elements .
"""
    Checks that no error is raised when all owners in a file are already in
    <owner> elements.
    """ # Write to the file so that it exists.
self