code: def run_cli(self, *args, commands=()):
      with (
          captured_stdin() as stdin,
          captured_stdout() as stdout,
          captured_stderr() as stderr,
          self.assertRaises(SystemExit) as cm,
      ):
          for cmd in commands:
              stdin.write(cmd + "\n")
          stdin.seek(0)
          cli(args)
  
      out = stdout.getvalue()
      err = stderr.getvalue()
      self.assertEqual(
          cm.exception.code,
          0,
          f"Unexpected failure: {args=}\n{out}\n{err}",
      )
      return out, err
  
imports: import sqlite3
  import unittest
  from sqlite3.__main__ import main
  from test.support.os_helper import TESTFN, unlink
  from test.support import captured_stdout, captured_stderr, captured_stdin
label_desc: Use image node_id 1 for calling the InteractiveSession obj's underlying member method code with example usage: obj.run_cli() and returns: out,  err