class_docstr: Tests for the NodeList class.
class_docstr_tok: ["Tests","for","the","NodeList","class","."]
code: def test_nodelist_item(self):
      # Test items access on a NodeList.
      # First, use an empty NodeList.
      node_list = NodeList()
  
      self.assertIsNone(node_list.item(0))
      self.assertIsNone(node_list.item(-1))
  
      with self.assertRaises(IndexError):
          node_list[0]
      with self.assertRaises(IndexError):
          node_list[-1]
  
      # Now, use a NodeList with items.
      node_list.append(111)
      node_list.append(999)
  
      self.assertEqual(node_list.item(0), 111)
      self.assertIsNone(node_list.item(-1))  # invalid item
  
      self.assertEqual(node_list[0], 111)
      self.assertEqual(node_list[-1], 999)
  
file_path: cpython/Lib/test/test_xml_dom_minicompat.py
imports: import copy
  import pickle
  import unittest
  import xml.dom
  from xml.dom.minicompat import *
label_desc: Use image node_id 1 for calling the NodeListTestCase obj's underlying member method code with example usage: obj.test_nodelist_item() without return types