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.

classification
Title: Packed IPaddr conversion tests should be extended
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: exarkun, loewis, neologix, phihag, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2009-03-05 13:37 by phihag, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
extend-packed-ip-tests-trunk2.x.diff phihag, 2009-03-05 13:37 patch against trunk@70188
issue5424.patch pitrou, 2011-01-05 18:21 review
Messages (6)
msg83195 - (view) Author: Philipp Hagemeister (phihag) * Date: 2009-03-05 13:37
Currently, the testStringToIPv6 and testIPv6ToStrings tests in
Lib/test/test_socket.py only check for variants 1 and 2 (but not 3) from
RFC 4291 2.2.

Furthermore, there are no assertions that check wrong inputs are
appropriately refused in any of the packed IP conversion tests.

The attached patch adds a number of assertions covering those.
msg109762 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-09 16:30
Adding tests into test_socket.py for invalid input can't be wrong can it?  Patch seems clean but would someone cast a more experienced Mk1 eyeball over it please.
msg125447 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-01-05 18:21
I'm not sure what the point of this patch is, since it's basically testing operating system behaviour, rather than Python behaviour. I think that we could have a single additional test case for bad inputs and leave it at that.
But in any case, here's the original patch ported to 3.x. Please comment.
msg149635 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-12-16 18:02
I agree with Antoine: a single test testing that we actually raise exceptions properly should be sufficient.

OTOH, the patch doesn't hurt (AFAICT), so I wouldn't mind if it was applied as-is.
msg149872 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-12-19 15:23
New changeset 71e5a083f9b1 by Antoine Pitrou in branch '3.2':
Issue #5424: add tests for inet_ntoa, inet_ntop, inet_aton and inet_pton.
http://hg.python.org/cpython/rev/71e5a083f9b1

New changeset a3d5f522065f by Antoine Pitrou in branch 'default':
Issue #5424: add tests for inet_ntoa, inet_ntop, inet_aton and inet_pton.
http://hg.python.org/cpython/rev/a3d5f522065f
msg149873 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-12-19 15:23
I have finally committed the patch. Thank you!
History
Date User Action Args
2022-04-11 14:56:46adminsetgithub: 49674
2011-12-19 15:23:45pitrousetstatus: open -> closed
resolution: fixed
messages: + msg149873

stage: patch review -> resolved
2011-12-19 15:23:15python-devsetnosy: + python-dev
messages: + msg149872
2011-12-16 18:02:22loewissetmessages: + msg149635
2011-12-16 11:21:58pitrousetnosy: + neologix
2011-01-05 18:21:21pitrousetfiles: + issue5424.patch
nosy: loewis, exarkun, pitrou, phihag
messages: + msg125447
2011-01-04 02:12:40pitrousetnosy: + exarkun, loewis, pitrou, - BreamoreBoy
2010-07-09 16:30:17BreamoreBoysetversions: + Python 3.2, - Python 3.1, Python 2.7
nosy: + BreamoreBoy

messages: + msg109762

stage: patch review
2009-03-05 13:37:16phihagcreate