net/data/parse_certificate_unittest/rebase-errors.py
def fixup_pem_file(path, actual_errors):
  """Updates the ERRORS block in the test .pem file"""
  contents = read_file_to_string(path)

  errors_block_text = '\n' + gencerts.text_data_to_pem('ERRORS', actual_errors)
  # Strip the trailing newline.
  errors_block_text = errors_block_text[:-1]

  m = errors_block_regex.search(contents)

  if not m:
    contents += errors_block_text
  else:
    contents = replace_string(contents, m.start(1), m.end(1),
                              errors_block_text)

  # Update the file.
  write_string_to_file(contents, path)
Updates the ERRORS block in the test .pem file
Updates the ERRORS block in the test .pem file
Updates the ERRORS block in the test . pem file
def fixup_pem_file(path, actual_errors):
  contents = read_file_to_string(path)
  errors_block_text = '\n' + gencerts.text_data_to_pem('ERRORS', actual_errors)
  errors_block_text = errors_block_text[:-1]
  m = errors_block_regex.search(contents)
  if not m:
    contents += errors_block_text
  else:
    contents = replace_string(contents, m.start(1), m.end(1),
                              errors_block_text)
  write_string_to_file(contents, path)
def fixup_pem_file ( path , actual_errors ) : contents = read_file_to_string ( path ) errors_block_text = '\n' + gencerts . text_data_to_pem ( 'ERRORS' , actual_errors ) errors_block_text = errors_block_text [ : - 1 ] m = errors_block_regex . search ( contents ) if not m : contents += errors_block_text else : contents = replace_string ( contents , m . start ( 1 ) , m . end ( 1 ) , errors_block_text ) write_string_to_file ( contents , path )
Updates the ERRORS block in the test .pem file
Updates the ERRORS block in the test . pem file
"""Updates the ERRORS block in the test .pem file""" # Strip the trailing newline. # Update the file.
path
actual_errors