R. Jayakrishnan added the comment: Now we have the mockText, So I updated my test for Idlehistory. The submitted patch2 contains tests for two methods in Idlehistory (history_store and History_do). I hope the tests for history_store are done. But the history_do method tests fails. I explored a bit on the failure trace, History_do method is called by PyShell.py before it calls, pyShell does self.text.mark_set("iomark", "insert") and passes the Text to IdleHistory. Now Idlehistory uses 'iomark' as an index. Mock Text's _decode only handles specific input indexes (as it mentions), that means this 'iomark' index failed to all the logic of _decode method and finally crosses line, char = index.split('.') line which eventually raises a ValueError: need more than 1 value to unpack.
One option is to create an issue to futher develop mock Text and implement mark_set also the _decode and so on, or Is it sounds like making stuffs more complex?, so we may decide the implemented tests are adequate enough for now. ---------- Added file: http://bugs.python.org/file30912/test_idlehistory1.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18425> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com