classification
Title: Add test cases for ctypes/winreg for issues found in IronPython
Type: behavior Stage: patch review
Components: ctypes, Windows Versions: Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: dino.viehland Nosy List: brett.cannon, brian.curtin, dino.viehland, ezio.melotti, michael.foord, theller (6)
Priority: normal Keywords patch

Created on 2010-02-04 19:17 by dino.viehland, last changed 2010-02-24 01:42 by brett.cannon.

Files
File name Uploaded Description Edit Remove
patch.diff dino.viehland, 2010-02-04 19:17 Patch against 2.x trunk
patch30.diff dino.viehland, 2010-02-04 19:17 Patch against 3.x trunk
patch30.diff dino.viehland, 2010-02-04 19:48 Updated 3.x patch using context manager for exception test
patch.diff dino.viehland, 2010-02-04 21:02 Updated 2.x patch with context manager
patch30.diff dino.viehland, 2010-02-04 21:02 Updated 3.x patch with assertTrue(... is True)
Messages (14)
msg98844 - (view) Author: Dino Viehland (dino.viehland) Date: 2010-02-04 19:17
This adds new test cases for bugs reported by Thomas Heller against IronPython for ctypes and winreg:
   ctypes: the variant bool type isn't supported
   winreg: errno is not correctly set when QueryValue fails
msg98845 - (view) Author: Brian Curtin (brian.curtin) Date: 2010-02-04 19:28
Rather than calling QueryValue and using fail(...) if it doesn't throw, assertRaises(...) would do the trick.
msg98846 - (view) Author: Ezio Melotti (ezio.melotti) Date: 2010-02-04 19:32
Also assertEqual(..., True) can be replaced by assertTrue(...) (same for False and assertFalse).
msg98847 - (view) Author: Dino Viehland (dino.viehland) Date: 2010-02-04 19:33
The problem with assertRaises is I need to actually check the errno on the exception and assertRaises doesn't let me do that.
msg98848 - (view) Author: Michael Foord (michael.foord) Date: 2010-02-04 19:33
Hmm... assertTrue(...) is semantically different from assertEqual(True, ...).
msg98849 - (view) Author: Michael Foord (michael.foord) Date: 2010-02-04 19:35
Dino - if you use assertRaises as a context manager the exception is kept as an attribute on the context. You can make assertions about the exception after the with block has executed.
msg98850 - (view) Author: Dino Viehland (dino.viehland) Date: 2010-02-04 19:38
I'll switch to the context manager form in the 3.x branch - it looks like that's not available in the 2.x branch.
msg98851 - (view) Author: Dino Viehland (dino.viehland) Date: 2010-02-04 19:49
Ezio: I'm going to stick w/ assertEqual here as Michael points out these are different.  In particular I want to make sure that you can assign any true value to the ctypes field but when you read it back you get True or False regardless of the value assigned.
msg98853 - (view) Author: Ezio Melotti (ezio.melotti) Date: 2010-02-04 20:15
For your purpose indeed assertTrue() is not appropriate, however assertEqual(x, True) works for several different x, including 1.0 or 1.
Also assertRaises can be used as a context manager on 2.7 too.
msg98857 - (view) Author: Dino Viehland (dino.viehland) Date: 2010-02-04 21:04
Ahh, so it is in 2.7, apparently I was in a 2.6 enlistment.  I've updated the 2.x patch to use the context manager as well.

I've also switched to using assertTrue(x is True) and assertTrue(x is False) so that it's not checking precisely for the bool value based upon Ezio's feedback.
msg99073 - (view) Author: Michael Foord (michael.foord) Date: 2010-02-08 23:46
Does this need committing? Dino - do you have checkin rights?
msg99075 - (view) Author: Dino Viehland (dino.viehland) Date: 2010-02-08 23:58
Brett Cannon was going to try and look at it and commit it.  If you think it looks good you can commit it :)

I do not yet have commit privledges simply because I need to gen my SSH key and send that off to Brett.  I'm also hoping to get a little hand holding on the 1st few check-ins.
msg99076 - (view) Author: Michael Foord (michael.foord) Date: 2010-02-08 23:59
Well, probably better for you to get the commit bit and DIY then. :-)
msg99991 - (view) Author: Brett Cannon (brett.cannon) * Date: 2010-02-24 01:42
Now that Dino has commit privileges and I just gave him the coordinator role, he can do the commit himself. =) Went ahead and assigned this issue to him.

And Dino, it would be helpful if you changed your username on the tracker to match your username on python-dev under "Your Details".
History
Date User Action Args
2010-02-24 01:42:37brett.cannonsetassignee: theller -> dino.viehland

messages: + msg99991
nosy: + brett.cannon
2010-02-08 23:59:10michael.foordsetmessages: + msg99076
2010-02-08 23:58:00dino.viehlandsetmessages: + msg99075
2010-02-08 23:46:37michael.foordsetmessages: + msg99073
2010-02-04 21:04:21dino.viehlandsetmessages: + msg98857
2010-02-04 21:02:48dino.viehlandsetfiles: + patch30.diff
2010-02-04 21:02:27dino.viehlandsetfiles: + patch.diff
2010-02-04 20:15:08ezio.melottisetpriority: normal

messages: + msg98853
stage: patch review
2010-02-04 19:49:15dino.viehlandsetmessages: + msg98851
2010-02-04 19:48:14dino.viehlandsetfiles: + patch30.diff
2010-02-04 19:38:34dino.viehlandsetmessages: + msg98850
2010-02-04 19:35:04michael.foordsetmessages: + msg98849
2010-02-04 19:33:42michael.foordsetmessages: + msg98848
2010-02-04 19:33:34dino.viehlandsetmessages: + msg98847
2010-02-04 19:32:19ezio.melottiset
nosy: + ezio.melotti
messages: + msg98846
priority: normal -> (no value)
assignee: theller
keywords: - needs review
stage: patch review -> (no value)
2010-02-04 19:28:43brian.curtinset
nosy: + brian.curtin, michael.foord
messages: + msg98845
priority: normal
assignee: theller -> (no value)
keywords: + needs review
stage: patch review
2010-02-04 19:17:58dino.viehlandsetfiles: + patch30.diff
type: behavior
versions: + Python 3.2
2010-02-04 19:17:09dino.viehlandcreate