Terry J. Reedy added the comment:

The new file is modeled on test_config_name.py, as appropriate. I think this 
was a good choice for a first test file. The complication you stumbled across 
is that the config help-source dialog has two entry boxes, whereas the config 
name dialog only has one. Therefore, the help-source check functions set the 
focus to the appropriate box when detecting an error, whereas the focus remains 
on the one box when the name check function detects an error.

Problem: the assertEquals on lines 41, 47, 57, and 64 in the test file fail 
with AttributeErrors attributed to lines 108, 115, 128, and 139 in the module. 
The failing module lines all look like
   self.entry(Menu/Path).focus_set()

Reason: The error message is "'dummy_helpsource_dialog' object has no attribute 
'entry(Menu/Path)'". This is true: the *dummy class instances* do not have such 
attributes.

Solution: add a mock Entry class to mock_tk with a dummy .focus_set method. Add 
mock Entry instances to dummy_helpsource_dialog as .entryMenu and .entryPath 
attributes. Tests now run. See 3.3 patch, which should almost work on 2.7.

I still have to review the actual tests, but I anticipate applying this with 
whatever additional changes I think are needed.

Also, when I added test_config_name.py in #18130, rev84040, I found and fixed a 
buglet in method NameOk(), now name_ok(), and otherwise brought the module code 
up to PEP8 standards. I want to check that MenuOk and PathOk do not have a 
similar buglet, and look at the style also.

----------
stage:  -> patch review
type:  -> enhancement
versions: +Python 2.7, Python 3.3
Added file: http://bugs.python.org/file34104/test-help-source.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20640>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to