classification
Title: Add unit test for spwd module
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Claudiu.Popa, python-dev, serhiy.storchaka, vajrasky
Priority: normal Keywords: patch

Created on 2013-12-08 04:20 by vajrasky, last changed 2014-05-25 13:33 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
unittest_for_spwd.patch vajrasky, 2013-12-08 04:21 review
unittest_for_spwd_v2.patch vajrasky, 2013-12-08 09:05 review
unittest_for_spwd_v3.patch vajrasky, 2014-05-25 11:06 review
Messages (6)
msg205513 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-12-08 04:20
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.
msg205526 - (view) Author: Claudiu Popa (Claudiu.Popa) * Date: 2013-12-08 07:26
Hi. I left a comment on Rietveld.
msg205532 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-12-08 09:05
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.
msg219082 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2014-05-25 11:06
Thanks, Serhiy, for the review! Here is the updated patch.
msg219087 - (view) Author: Roundup Robot (python-dev) Date: 2014-05-25 13:24
New changeset c35274fe5b35 by Serhiy Storchaka in branch '2.7':
Issue #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 #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 #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
http://hg.python.org/cpython/rev/4b187f5aa960
msg219089 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-05-25 13:33
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.
History
Date User Action Args
2014-05-25 13:33:54serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg219089

stage: resolved
2014-05-25 13:24:10python-devsetnosy: + python-dev
messages: + msg219087
2014-05-25 11:06:04vajraskysetfiles: + unittest_for_spwd_v3.patch

messages: + msg219082
2014-05-25 09:44:45serhiy.storchakasetassignee: serhiy.storchaka

type: enhancement
nosy: + serhiy.storchaka
versions: + Python 2.7, Python 3.5
2013-12-08 09:05:42vajraskysetfiles: + unittest_for_spwd_v2.patch

messages: + msg205532
2013-12-08 07:26:24Claudiu.Popasetnosy: + Claudiu.Popa
messages: + msg205526
2013-12-08 04:21:43vajraskysetfiles: + unittest_for_spwd.patch
2013-12-08 04:21:25vajraskysetfiles: - unittest_for_spwd.patch
2013-12-08 04:20:32vajraskycreate