code: def testIncompleteRedirectWorks(self):
      _, output_path = tempfile.mkstemp()  # safe to ignore fd
  
      ui = MockReadlineUI(
          command_sequence=["babble -n 2 > %s" % output_path, "exit"]
      )
  
      ui.register_command_handler("babble", self._babble, "")
      ui.run_ui()
  
      screen_outputs = ui.observers["screen_outputs"]
      self.assertEqual(1, len(screen_outputs))
      self.assertEqual(["bar"] * 2, screen_outputs[0].lines)
  
      with gfile.Open(output_path, "r") as f:
          self.assertEqual("bar\nbar\n", f.read())
  
imports: import os
  import argparse
  import tempfile
  from tensorflow.python.debug.cli import cli_config
  from tensorflow.python.debug.cli import debugger_cli_common
  from tensorflow.python.debug.cli import readline_ui
  from tensorflow.python.debug.cli import ui_factory
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 13 for calling the CursesTest obj's underlying member method code with example usage: obj.testIncompleteRedirectWorks() without return types