[issue18425] IDLE Unit test for IdleHistory.py

R. Jayakrishnan report at bugs.python.org
Sun Jul 14 08:50:45 CEST 2013


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 <report at bugs.python.org>
<http://bugs.python.org/issue18425>
_______________________________________


More information about the Python-bugs-list mailing list