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

Add unit test for spwd module #64124

Closed
vajrasky mannequin opened this issue Dec 8, 2013 · 6 comments
Closed

Add unit test for spwd module #64124

vajrasky mannequin opened this issue Dec 8, 2013 · 6 comments
Assignees
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@vajrasky
Copy link
Mannequin

vajrasky mannequin commented Dec 8, 2013

BPO 19925
Nosy @PCManticore, @serhiy-storchaka, @vajrasky
Files
  • unittest_for_spwd.patch
  • unittest_for_spwd_v2.patch
  • unittest_for_spwd_v3.patch
  • 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/serhiy-storchaka'
    closed_at = <Date 2014-05-25.13:33:54.768>
    created_at = <Date 2013-12-08.04:20:32.528>
    labels = ['type-feature', 'tests']
    title = 'Add unit test for spwd module'
    updated_at = <Date 2014-05-25.13:33:54.766>
    user = 'https://github.com/vajrasky'

    bugs.python.org fields:

    activity = <Date 2014-05-25.13:33:54.766>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-05-25.13:33:54.768>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2013-12-08.04:20:32.528>
    creator = 'vajrasky'
    dependencies = []
    files = ['33035', '33040', '35347']
    hgrepos = []
    issue_num = 19925
    keywords = ['patch']
    message_count = 6.0
    messages = ['205513', '205526', '205532', '219082', '219087', '219089']
    nosy_count = 4.0
    nosy_names = ['Claudiu.Popa', 'python-dev', 'serhiy.storchaka', 'vajrasky']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue19925'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @vajrasky
    Copy link
    Mannequin Author

    vajrasky mannequin commented Dec 8, 2013

    So we may have buildbot with root account after all. https://mail.python.org/pipermail/python-dev/2013-December/130708.html

    So here is the unit test for spwd module that requires root account.

    @vajrasky vajrasky mannequin added the tests Tests in the Lib/test dir label Dec 8, 2013
    @PCManticore
    Copy link
    Mannequin

    PCManticore mannequin commented Dec 8, 2013

    Hi. I left a comment on Rietveld.

    @vajrasky
    Copy link
    Mannequin Author

    vajrasky mannequin commented Dec 8, 2013

    Hi Claudiu, thanks for the review and the knowledge that on Windows, we don't have attribute getuid of os. Here is the updated patch. I do not check specifically for Windows but only whether the platform can import spwd module or not. That should be enough.

    @serhiy-storchaka serhiy-storchaka self-assigned this May 25, 2014
    @serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label May 25, 2014
    @vajrasky
    Copy link
    Mannequin Author

    vajrasky mannequin commented May 25, 2014

    Thanks, Serhiy, for the review! Here is the updated patch.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 25, 2014

    New changeset c35274fe5b35 by Serhiy Storchaka in branch '2.7':
    Issue bpo-19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
    http://hg.python.org/cpython/rev/c35274fe5b35

    New changeset 9bdbe0b08dff by Serhiy Storchaka in branch '3.4':
    Issue bpo-19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
    http://hg.python.org/cpython/rev/9bdbe0b08dff

    New changeset 4b187f5aa960 by Serhiy Storchaka in branch 'default':
    Issue bpo-19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
    http://hg.python.org/cpython/rev/4b187f5aa960

    @serhiy-storchaka
    Copy link
    Member

    Committed with some changes. geteuid() is used instead getuid(), and checked that os.geteuid exists (see test_shutil). Checked deprecated attributes sp_nam and sp_pwd. Added tests for the calling getspnam() with wrong number of arguments and with bytes (on 3.x) or unicode (2.7) name.

    Thank you Vajrasky for your contribution.

    @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
    tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant