Back to index

python3.2  3.2.2
Public Member Functions
test.test_readline.TestHistoryManipulation Class Reference

List of all members.

Public Member Functions

def testHistoryUpdates

Detailed Description

Definition at line 14 of file test_readline.py.


Member Function Documentation

Definition at line 19 of file test_readline.py.

00019 
00020     def testHistoryUpdates(self):
00021         readline.clear_history()
00022 
00023         readline.add_history("first line")
00024         readline.add_history("second line")
00025 
00026         self.assertEqual(readline.get_history_item(0), None)
00027         self.assertEqual(readline.get_history_item(1), "first line")
00028         self.assertEqual(readline.get_history_item(2), "second line")
00029 
00030         readline.replace_history_item(0, "replaced line")
00031         self.assertEqual(readline.get_history_item(0), None)
00032         self.assertEqual(readline.get_history_item(1), "replaced line")
00033         self.assertEqual(readline.get_history_item(2), "second line")
00034 
00035         self.assertEqual(readline.get_current_history_length(), 2)
00036 
00037         readline.remove_history_item(0)
00038         self.assertEqual(readline.get_history_item(0), None)
00039         self.assertEqual(readline.get_history_item(1), "second line")
00040 
00041         self.assertEqual(readline.get_current_history_length(), 1)
00042 

Here is the call graph for this function:


The documentation for this class was generated from the following file: