[issue18425] IDLE Unit test for IdleHistory.py

2013-08-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ezio: grepping test/*.py for (name)'= self.assertEqual' gets 182 hits in 15 
different files. If you are generically opposed to name localization, please 
take your case to pydev. I also found 'unless = self.assertTrue' and am sure I 
have seen others in the stdlib and test files.

For (name), there is 1 use of 'e' and 'asseq', 5 of 'equal', and 175 of 'eq'. 
(In one place, 'eq' was only used once after being defined. I would not 
bother.) If you have a strong preference for 'eq', I will consider it, though 
it almost seems too light.

--

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-18 Thread Ezio Melotti

Ezio Melotti added the comment:

 If you are generically opposed to name localization, please take your
 case to pydev.

I'm not strongly opposed to it, I probably even use it sometimes.  In that case 
I wouldn't have bothered, but YMMV.

--

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0e9d41edb2e4 by Terry Jan Reedy in branch '2.7':
Issue #18425: Unittests for idlelib.IdleHistory. First patch by R. Jayakrishnan.
http://hg.python.org/cpython/rev/0e9d41edb2e4

New changeset c4cac5d73e9d by Terry Jan Reedy in branch '3.3':
Issue #18425: Unittests for idlelib.IdleHistory. First patch by R. Jayakrishnan.
http://hg.python.org/cpython/rev/c4cac5d73e9d

--

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-15 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
resolution:  - fixed
superseder:  - IdleHistory.History: eliminate unused parameter; other cleanup.

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-15 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
status: open - closed

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Moved most initialization to method setUp to prevent cascading of test 
failures. Added info about History.fetch and FetchTest.fetch_test methods. 
Added tests for non-cyclic and special behavior and for fetch event wrappers. 
Coverage is essentially 100%.

--
stage: patch review - committed/rejected
Added file: http://bugs.python.org/file31296/test_idlehistory4.diff

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0bb9346665e9 by Terry Jan Reedy in branch '3.3':
Issue #18425: Add docstrings to IdleHistory.py.  Remove redundant 'history_'
http://hg.python.org/cpython/rev/0bb9346665e9

New changeset 22d7c755163d by Terry Jan Reedy in branch '2.7':
Issue #18425: Add docstrings to IdleHistory.py.  Remove redundant 'history_'
http://hg.python.org/cpython/rev/22d7c755163d

--
nosy: +python-dev

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

IdleHistory.py is identical in 2.7 and 3.3. It is only imported in PyShell.py 
(within class PyShell, line 852 in 3.3). History is only initialized once, with 
the default output_sep. See #18732 for deleting the unneeded parameter and 
associated cruft.

The pushed patch adds docstrings and a couple of comments and removes most of 
the redundant prefixes. It does not change any logic.

The attached patch started as JK's patch with names changed and Ezio's changes. 
All test methods pass. There are three chunks of History.fetch that are not 
covered. Two require cyclic=False. The other requires special situations with 
text or cursor changes after one call to fetch but before the next. I will add 
these soon and push.

--

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-13 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


Added file: http://bugs.python.org/file31287/test_idlehistory3.diff

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-08-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-21 Thread R. Jayakrishnan

Changes by R. Jayakrishnan raaj...@gmail.com:


--
resolution:  - works for me

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Resolution is for when the issue is closed, and I expect this to be closed as 
'fixed'.

--
assignee:  - terry.reedy
resolution: works for me - 
stage:  - patch review

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-18 Thread R. Jayakrishnan

R. Jayakrishnan added the comment:

Thanks Terry for we have the option of gui tests when mocking becomes too 
complicated

I put two separate classes IdleHistoryMockTest and IdleHistoryTKTest for mock 
and TK text usages and used TK Text to test IdleHistory.history_do function. 
This worked for me and hopefully IMHO the logic behind history_do is tested 
enough for now.

--
Added file: http://bugs.python.org/file30963/test_idlehistory2.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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As I said on one of the other issues, which I hope you read, we have the option 
of gui tests when mocking becomes too complicated. So at least for now, put the 
test that requires marks in a separate test case with requires('gui') in 
setUPClass.

The problem with a full implementation of marks is that they change position 
when text is inserted or deleted before their position. Also, some mark 
functions are easier if they are stored in a dict, while one function and the 
movement operations are easier if they are stored in a sorted list. A partial 
implementation that allowed only 1 or 2 marks would be easier that a full 
implementation allowing any number. Mock marks that do not move (and don't need 
to because of no inserts or deletes between definition and use) would also be 
easy. So I want to see how marks need to be used for testing before doing 
anything.

Even when a mock is used, we can temporarily use the tk version to verify that 
the mock is working right. I did that in the patch for #18279. See the 
commented out code in
http://hg.python.org/cpython/rev/22ce68d98345.

--

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-14 Thread R. Jayakrishnan

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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-10 Thread R. Jayakrishnan

New submission from R. Jayakrishnan:

Continuing the IDLE unittest framework #15392, unit test for IdleHistory.py. 
This test depends on mockText and uses the patch by Terry at issue #18365.
Because the mockText is still about to commit, first patch 
http://bugs.python.org/file30865/mock_text2.diff and then use 
test_idlehistory.patch to run test_idlehistory. 
Once the mock Text get committed I will improve the patch according to.

--
components: IDLE
files: test_idlehistory.patch
keywords: patch
messages: 192840
nosy: JayKrish, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE Unit test for IdleHistory.py
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30885/test_idlehistory.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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-10 Thread Phil Webster

Changes by Phil Webster webster.p...@gmail.com:


--
nosy: +philwebster

___
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



[issue18425] IDLE Unit test for IdleHistory.py

2013-07-10 Thread Todd Rovito

Changes by Todd Rovito rovit...@gmail.com:


--
nosy: +Todd.Rovito

___
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