[issue18365] Idle: mock Text class and test thereof

2013-07-04 Thread Terry J. Reedy
New submission from Terry J. Reedy: test_rstrip2.patch contain a Text class to be added to mock_tk.py. The purpose of a mock class is to imitate another class with respect to certain behaviors. The way to verify that is does that is to run the same set of tests for those behaviors with both. T

[issue18365] Idle: mock Text class and test thereof

2013-07-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: The rstrip patch is with #18279. Design discussion occurred on #18226. Both issues and other future issues depend on this one. -- ___ Python tracker __

[issue18365] Idle: mock Text class and test thereof

2013-07-07 Thread Phil Webster
Phil Webster added the comment: Added Text class to mock_tk.py and GUI/non-GUI tests in test_text.py. Running the IDLE tests produced no errors for me. -- keywords: +patch Added file: http://bugs.python.org/file30851/mock_text.patch ___ Python tracke

[issue18365] Idle: mock Text class and test thereof

2013-07-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: Great start! Some revisions: * Create root directly (and just once); add root.destroy, which added several warnings. * Create Text directly; test should not require Editors. This removed warnings. I suspect that EditorWindow.py does other things that are not pr

[issue18365] Idle: mock Text class and test thereof

2013-07-10 Thread R. Jayakrishnan
Changes by R. Jayakrishnan : -- nosy: +JayKrish ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: Upon further review and tests, I notice that ._decode * is a partial implementation of Text.index, * so it should be renamed index and tested against Text.index, * and it currently returns the wrong values for 'end' and high out-of-bounds indexes. Tests with 'e

[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: Whoops, I got that partly wrong in that index returns a 'r.c' string after doing what _decode is supposed to do, which is to decode the input according to the current text. The mock index should just return '%s.%s' % _decode(position). There is still the point

[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Phil Webster
Phil Webster added the comment: Thanks Terry, I will start PEP8-checking my code before I submit (as well as testing more thoroughly). I was thinking the same thing about the logic behind _decode and index functions needing to be combined. How would you recommend adding functionality to the de

[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: The real problem with 'end' and 'big.m' is that there are three proper decodings, depending on the method asking. I think this patch mostly solves the problems mentioned before. All tests, including many new ones, pass. -- Added file: http://bugs.pytho

[issue18365] Idle: mock Text class and test thereof

2013-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: A little more polishing and the tests pass again. I think I am done with the implemented methods. Before I commit, I want to review the set of 'pass' functions. It seems a bit haphazard. I think display changing methods like .see are fine.I am not sure about i

[issue18365] Idle: mock Text class and test thereof

2013-07-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I want to commit this patch more or less as is so we can move forward with the tests that do not need anything more. We can then elaborate mock Text as needed and desired. Looking at http://effbot.org/tkinterbook/text.htm, for instance, I see that 'lineend' i

[issue18365] Idle: mock Text class and test thereof

2013-07-12 Thread Phil Webster
Phil Webster added the comment: Using tk.Text for more involved tests sounds good (at least as a start). The pass functions were used to get the FormatParagraph test (#18226) working. I've been using the same effbot.org site as a reference and haven't found anything more detailed. --

[issue18365] Idle: mock Text class and test thereof

2013-07-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5ac2ec0a34a5 by Terry Jan Reedy in branch '2.7': Issue #18365: Add mock Text class and test thereof versus tk.Text. http://hg.python.org/cpython/rev/5ac2ec0a34a5 New changeset 8f13fb4c5826 by Terry Jan Reedy in branch '3.3': Issue #18365: Add mock T

[issue18365] Idle: mock Text class and test thereof

2013-07-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I documented and left most of the 'pass' methods. The bind method is inherited from Misc class and is not specifically a Text method, but I will leave it here for now. These def undo_block_start(self, *args): pass def undo_block_stop(self, *ar

[issue18365] Idle: mock Text class and test thereof

2013-07-12 Thread R. David Murray
R. David Murray added the comment: Looks like this is causing buildbot failures: http://buildbot.python.org/all/builders/x86%20RHEL%206%203.x/builds/2330/steps/test/logs/stdio http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/6094/steps/test/logs/stdio -- nosy: +

[issue18365] Idle: mock Text class and test thereof

2013-07-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 008d83c4efaf by Terry Jan Reedy in branch '2.7': Issue #18365: 2.7 corrections so tests run http://hg.python.org/cpython/rev/008d83c4efaf -- ___ Python tracker ___

[issue18365] Idle: mock Text class and test thereof

2013-07-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Well, that is annoying. I expected 2.7 failures due to mistakes already corrected, but not with 3.x, and these look to be the latter. == ERROR: setUpClass (idlelib.idle_test.test_text.TkTextTes

[issue18365] Idle: mock Text class and test thereof

2013-07-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset bc3a34e47923 by Terry Jan Reedy in branch '3.3': Issue #18365: convert buildbot errors to skips. http://hg.python.org/cpython/rev/bc3a34e47923 New changeset ba4c826848d5 by Terry Jan Reedy in branch '2.7': Issue #18365: convert buildbot errors to sk

[issue18365] Idle: mock Text class and test thereof

2013-07-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: Looking through the 11 stable 3.x buildbots (1 still running), I see 3 outcomes. 1. Windows: test seemed to run, test_idle listed in 'altered environment'. 2. Some *nix: test gave no error, test_idle lit in 'tests skipped'. I presume this means that at least one

[issue18365] Idle: mock Text class and test thereof

2013-07-13 Thread R. David Murray
R. David Murray added the comment: Yeah, DISPLAY is how unix finds the X11 display. I don't remember how the tkguionly tests deal with that being missing, but since the tests are run "headless" there is indeed no DISPLAY for the tests to talk to. -- __

[issue18365] Idle: mock Text class and test thereof

2013-07-13 Thread R. David Murray
R. David Murray added the comment: Looks like ttk_guionly gets skipped on my buildbot because of the following code at the top of test_ttk_guionly: try: ttk.Button() except TclError as msg: # assuming ttk is not available raise unittest.SkipTest("ttk not available: %s" %

[issue18365] Idle: mock Text class and test thereof

2013-07-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: The change worked, so this issue can be closed. I opened a new issue, #18441, for dealing with the problem in test_idle by moving the TclError check there, so it does not arise in other idle_test/test_*.py files. -- stage: needs patch -> committed/reje