tools/metrics/histograms/expand_owners_unittest.py
def testExtractEmailAddressesLoopRaisesError(self):
    """Checks that an error is raised if OWNERS file path results in a loop."""
    file_directive_absolute_path = _MakeOwnersFile('loop_OWNERS', self.temp_dir)

    directive = _GetFileDirective(file_directive_absolute_path)
    with open(file_directive_absolute_path, 'w') as owners_file:
      owners_file.write(directive)

    with self.assertRaisesRegexp(
        expand_owners.Error,
        r'.*The path.*loop_OWNERS may be part of an OWNERS loop\.'):
      expand_owners._ExtractEmailAddressesFromOWNERS(
          file_directive_absolute_path)
Checks that an error is raised if OWNERS file path results in a loop.
Checks that an error is raised if OWNERS file path results in a loop.
Checks that an error is raised if OWNERS file path results in a loop .
def testExtractEmailAddressesLoopRaisesError(self):
    file_directive_absolute_path = _MakeOwnersFile('loop_OWNERS', self.temp_dir)
    directive = _GetFileDirective(file_directive_absolute_path)
    with open(file_directive_absolute_path, 'w') as owners_file:
      owners_file.write(directive)
    with self.assertRaisesRegexp(
        expand_owners.Error,
        r'.*The path.*loop_OWNERS may be part of an OWNERS loop\.'):
      expand_owners._ExtractEmailAddressesFromOWNERS(
          file_directive_absolute_path)
def testExtractEmailAddressesLoopRaisesError ( self ) : file_directive_absolute_path = _MakeOwnersFile ( 'loop_OWNERS' , self . temp_dir ) directive = _GetFileDirective ( file_directive_absolute_path ) with open ( file_directive_absolute_path , 'w' ) as owners_file : owners_file . write ( directive ) with self . assertRaisesRegexp ( expand_owners . Error , r'.*The path.*loop_OWNERS may be part of an OWNERS loop\.' ) : expand_owners . _ExtractEmailAddressesFromOWNERS ( file_directive_absolute_path )
Checks that an error is raised if OWNERS file path results in a loop.
Checks that an error is raised if OWNERS file path results in a loop .
"""Checks that an error is raised if OWNERS file path results in a loop."""
self