code: def testOutput(self):
      output = GetOutputOfAllCommands()
  
      golden_file = open(GOLDEN_PATH, "rb")
      # A mis-configured source control system can cause \r appear in EOL
      # sequences when we read the golden file irrespective of an operating
      # system used. Therefore, we need to strip those \r's from newlines
      # unconditionally.
      golden = ToUnixLineEnding(golden_file.read().decode())
      golden_file.close()
  
      # We want the test to pass regardless of certain features being
      # supported or not.
  
      # We still have to remove type name specifics in all cases.
      normalized_actual = RemoveTypeInfoDetails(output)
      normalized_golden = RemoveTypeInfoDetails(golden)
  
      if CAN_GENERATE_GOLDEN_FILE:
          self.assertEqual(
              normalized_golden,
              normalized_actual,
              "\n".join(
                  difflib.unified_diff(
                      normalized_golden.split("\n"),
                      normalized_actual.split("\n"),
                      "golden",
                      "actual",
                  )
              ),
          )
      else:
          normalized_actual = NormalizeToCurrentPlatform(
              RemoveTestCounts(normalized_actual)
          )
          normalized_golden = NormalizeToCurrentPlatform(
              RemoveTestCounts(
                  self.RemoveUnsupportedTests(normalized_golden)
              )
          )
  
          # This code is very handy when debugging golden file differences:
          if os.getenv("DEBUG_GTEST_OUTPUT_TEST"):
              open(
                  os.path.join(
                      gtest_test_utils.GetSourceDir(),
                      "_googletest-output-test_normalized_actual.txt",
                  ),
                  "wb",
              ).write(normalized_actual)
              open(
                  os.path.join(
                      gtest_test_utils.GetSourceDir(),
                      "_googletest-output-test_normalized_golden.txt",
                  ),
                  "wb",
              ).write(normalized_golden)
  
          self.assertEqual(normalized_golden, normalized_actual)
  
imports: import difflib
  import os
  import re
  import sys
  from googletest.test import gtest_test_utils
label_desc: Use image node_id 2 for calling the GTestOutputTest obj's underlying member method code with example usage: obj.testOutput() without return types