This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Saimadhav.Heblikar, Todd.Rovito, serhiy.storchaka, taleinat, terry.reedy
Date 2014-02-16.18:39:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392575955.3.0.368220099954.issue20640@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-02-16 18:39:15terry.reedysetrecipients: + terry.reedy, taleinat, Todd.Rovito, serhiy.storchaka, Saimadhav.Heblikar
2014-02-16 18:39:15terry.reedysetmessageid: <1392575955.3.0.368220099954.issue20640@psf.upfronthosting.co.za>
2014-02-16 18:39:15terry.reedylinkissue20640 messages
2014-02-16 18:39:14terry.reedycreate