code: def test_checkcache(self):
      getline = linecache.getline
      # Create a source file and cache its contents
      source_name = os_helper.TESTFN + ".py"
      self.addCleanup(os_helper.unlink, source_name)
      with open(source_name, "w", encoding="utf-8") as source:
          source.write(SOURCE_1)
      getline(source_name, 1)
  
      # Keep a copy of the old contents
      source_list = []
      with open(source_name, encoding="utf-8") as source:
          for index, line in enumerate(source):
              self.assertEqual(line, getline(source_name, index + 1))
              source_list.append(line)
  
      with open(source_name, "w", encoding="utf-8") as source:
          source.write(SOURCE_2)
  
      # Try to update a bogus cache entry
      linecache.checkcache("dummy")
  
      # Check that the cache matches the old contents
      for index, line in enumerate(source_list):
          self.assertEqual(line, getline(source_name, index + 1))
  
      # Update the cache and check whether it matches the new source file
      linecache.checkcache(source_name)
      with open(source_name, encoding="utf-8") as source:
          for index, line in enumerate(source):
              self.assertEqual(line, getline(source_name, index + 1))
              source_list.append(line)
  
imports: import linecache
  import unittest
  import os.path
  import tempfile
  import tokenize
  from test import support
  from test.support import os_helper
label_desc: Use image node_id 4 for calling the LineCacheTests obj's underlying member method code with example usage: obj.test_checkcache() without return types