class_docstr: Base class for end-to-end testing of TFX templates.
docstr: Update given file using `replacements`.
docstr_tok: ["Update","given","file","using","`","replacements","`","."]
code: def _replaceFileContent(
      self, filepath: str, replacements: Iterable[Tuple[str, str]]
  ) -> str:
      """Update given file using `replacements`."""
      path = os.path.join(self._project_dir, filepath)
      with open(path) as fp:
          content = fp.read()
      for old, new in replacements:
          content = content.replace(old, new)
      io_utils.write_string_file(path, content)
      return path
  
imports: import os
  import re
  from typing import List, Iterable, Tuple
  from tfx.tools.cli.e2e import test_utils
  from tfx.utils import io_utils
  from tfx.utils import test_case_utils
label_desc: Use image node_id 6 for calling the BaseEndToEndTest obj's underlying member method code with example usage: obj._replaceFileContent(filepath, replacements) and returns: path