code: def test_set_code(self):
      eq = self.assertEqual
      p = self.parser
      setcode = p.set_code
  
      # Not empty and doesn't end with newline.
      with self.assertRaises(AssertionError):
          setcode("a")
  
      tests = ("", "a\n")
  
      for string in tests:
          with self.subTest(string=string):
              setcode(string)
              eq(p.code, string)
              eq(p.study_level, 0)
  
imports: from idlelib import pyparse
  import unittest
  from collections import namedtuple
label_desc: Use image node_id 4 for calling the PyParseTest obj's underlying member method code with example usage: obj.test_set_code() without return types