Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE: Add tests for configdialog keys tab #75185

Closed
terryjreedy opened this issue Jul 24, 2017 · 10 comments
Closed

IDLE: Add tests for configdialog keys tab #75185

terryjreedy opened this issue Jul 24, 2017 · 10 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement

Comments

@terryjreedy
Copy link
Member

BPO 31002
Nosy @terryjreedy, @csabella
PRs
  • bpo-31002: IDLE: Add tests for configdialog keys tab #2996
  • [3.6] bpo-31002: IDLE: Add tests for configdialog keys tab (GH-2996) #3092
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2017-08-15.01:55:44.277>
    created_at = <Date 2017-07-24.07:25:08.138>
    labels = ['expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: Add tests for configdialog keys tab'
    updated_at = <Date 2017-08-15.21:50:09.573>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2017-08-15.21:50:09.573>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2017-08-15.01:55:44.277>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2017-07-24.07:25:08.138>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31002
    keywords = []
    message_count = 10.0
    messages = ['299624', '299633', '299678', '299723', '300114', '300124', '300274', '300277', '300280', '300311']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'cheryl.sabella']
    pr_nums = ['2996', '3092']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue31002'
    versions = ['Python 3.6', 'Python 3.7']

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Jul 24, 2017
    @terryjreedy terryjreedy self-assigned this Jul 24, 2017
    @terryjreedy terryjreedy added topic-IDLE type-feature A feature request or enhancement labels Jul 24, 2017
    @csabella
    Copy link
    Contributor

    csabella commented Aug 1, 2017

    I'm working on the tests for this.

    @terryjreedy
    Copy link
    Member Author

    Great. It is non-trivial, so I don't expect perfection first try. Please revise docstring with explanation of how page works, like with Font and General pages. I finished tests using those explanations as a guide. They are also a guide for review.

    @csabella
    Copy link
    Contributor

    csabella commented Aug 3, 2017

    I'm making good progress on this. I should be able to open the PR tomorrow. It's definitely non-trivial, but using your font and general tests as a guide has been invaluable.

    @csabella
    Copy link
    Contributor

    csabella commented Aug 3, 2017

    I tried to minimize the changes to configdialog. There were more I wanted to make, like reorganizing the order of the functions, but I didn't want to make the diff too crazy. I changed some variable names because all of them had 'keys' in it and I couldn't keep track of them. It was almost as descriptive as single letter variables! ;-) I think I made the new names inline with what had been done on the font and general tabs. Again, there were more renaming changes I wanted to make (such as key_set to keyset), but I didn't want every line to be a diff.

    Also, I used the name 'keyset' to refer to the section names and the keybindings to refer to the option:value pairs. Some old vars in configdialog weren't changed to reflect this 100%, but the comment should be correct.

    I did not include deactivate_current_config and activate_config__changes since those are not really specific to keys. There are also invoked from themes and from apply.

    I have notes for some of the other coding changes I'd like to make once this is in its own class.

    @terryjreedy
    Copy link
    Member Author

    I am not sure I agree with all your suggested name changes. But I am looking as more substantive issues first.

    @terryjreedy
    Copy link
    Member Author

    I have thought about factoring out common test code into helper functions either within test_configdialog or in a new module. One example: simulate a click on a listbox, with common before and after code. Another: Testing the group of selection widgets on both theme and keys pages. (If I were not planning to replace this group, we could factor out a SelectionFrame and put an instance on each page.)

    We might do some such refactoring after this, before HighPageTest. Keep notes on redundancies you notice that might be candidates.

    @terryjreedy
    Copy link
    Member Author

    New changeset 2f89646 by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
    bpo-31002: IDLE: Add tests for configdialog keys tab (bpo-2996)
    2f89646

    @terryjreedy
    Copy link
    Member Author

    New changeset a314590 by Terry Jan Reedy in branch '3.6':
    [3.6] bpo-31002: IDLE: Add tests for configdialog keys tab (GH-2996) (bpo-3092)
    a314590

    @terryjreedy
    Copy link
    Member Author

    Great work. Thank you.
    Next: bpo-31205, bpo-31001, bpo-31206, then ...

    @terryjreedy
    Copy link
    Member Author

    Lines not yet covered in keys group, other than deactivate_current_config and activate_config_changes functions:

    def save_new_key_set
    if not idleConf.userCfg['keys'].has_section(keyset_name):
    # never false - minor issue

    def delete_custom_keys
    if not item_list:
    # never false hence following never executed
    else: self.customlist.SetMenu(item_list, item_list[0])

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants