code: def test_writelines(self):
      shell = MockShell()
      f = run.StdOutputFile(shell, "stdout")
      f.writelines([])
      self.assertEqual(shell.written, [])
      shell.reset()
      f.writelines(["one\n", "two"])
      self.assertEqual(
          shell.written, [("one\n", "stdout"), ("two", "stdout")]
      )
      shell.reset()
      f.writelines(["on\xe8\n", "tw\xf2"])
      self.assertEqual(
          shell.written, [("on\xe8\n", "stdout"), ("tw\xf2", "stdout")]
      )
      shell.reset()
  
      f.writelines([S("t\xe8st")])
      self.assertEqual(shell.written, [("t\xe8st", "stdout")])
      self.assertEqual(type(shell.written[0][0]), str)
      shell.reset()
  
      self.assertRaises(TypeError, f.writelines)
      self.assertEqual(shell.written, [])
      self.assertRaises(TypeError, f.writelines, 123)
      self.assertEqual(shell.written, [])
      self.assertRaises(TypeError, f.writelines, [b"test"])
      self.assertRaises(TypeError, f.writelines, [123])
      self.assertEqual(shell.written, [])
      self.assertRaises(TypeError, f.writelines, [], [])
      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 5 for calling the StdOutputFilesTest obj's underlying member method code with example usage: obj.test_writelines() without return types