class_docstr: These tests were added to check that the libedit emulation on OSX and the
  "real" readline have the same interface for history manipulation. That's
  why the tests cover only a small subset of the interface.
class_docstr_tok: ["These","tests","were","added","to","check","that","the","libedit","emulation","on","OSX","and","the","''","real","''","readline","have","the","same","interface","for","history","manipulation",".","That's","why","the","tests","cover","only","a","small","subset","of","the","interface","."]
code: def testHistoryUpdates(self):
      readline.clear_history()
  
      readline.add_history("first line")
      readline.add_history("second line")
  
      self.assertEqual(readline.get_history_item(0), None)
      self.assertEqual(readline.get_history_item(1), "first line")
      self.assertEqual(readline.get_history_item(2), "second line")
  
      readline.replace_history_item(0, "replaced line")
      self.assertEqual(readline.get_history_item(0), None)
      self.assertEqual(readline.get_history_item(1), "replaced line")
      self.assertEqual(readline.get_history_item(2), "second line")
  
      self.assertEqual(readline.get_current_history_length(), 2)
  
      readline.remove_history_item(0)
      self.assertEqual(readline.get_history_item(0), None)
      self.assertEqual(readline.get_history_item(1), "second line")
  
      self.assertEqual(readline.get_current_history_length(), 1)
  
imports: import locale
  import os
  import sys
  import tempfile
  import textwrap
  import unittest
  from test.support import verbose
  from test.support.import_helper import import_module
  from test.support.os_helper import unlink, temp_dir, TESTFN
  from test.support.pty_helper import run_pty
  from test.support.script_helper import assert_python_ok
label_desc: Use image node_id 1 for calling the TestHistoryManipulation obj's underlying member method code with example usage: obj.testHistoryUpdates() without return types