code: def test_write(self):
      shell = MockShell()
      f = run.StdOutputFile(shell, "stdout")
      f.write("test")
      self.assertEqual(shell.written, [("test", "stdout")])
      shell.reset()
      f.write("t\xe8\u015b\U0001d599")
      self.assertEqual(
          shell.written, [("t\xe8\u015b\U0001d599", "stdout")]
      )
      shell.reset()
  
      f.write(S("t\xe8\u015b\U0001d599"))
      self.assertEqual(
          shell.written, [("t\xe8\u015b\U0001d599", "stdout")]
      )
      self.assertEqual(type(shell.written[0][0]), str)
      shell.reset()
  
      self.assertRaises(TypeError, f.write)
      self.assertEqual(shell.written, [])
      self.assertRaises(TypeError, f.write, b"test")
      self.assertRaises(TypeError, f.write, 123)
      self.assertEqual(shell.written, [])
      self.assertRaises(TypeError, f.write, "test", "spam")
      self.assertEqual(shell.written, [])
  
imports: from idlelib import run
  import io
  import sys
  from test.support import captured_output, captured_stderr
  import unittest
  from unittest import mock
  import idlelib
  from idlelib.idle_test.mock_idle import Func
label_desc: Use image node_id 3 for calling the StdOutputFilesTest obj's underlying member method code with example usage: obj.test_write() without return types