diff options
author | Guido van Rossum <guido@python.org> | 2007-07-17 20:50:43 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-17 20:50:43 (GMT) |
commit | a8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (patch) | |
tree | 68196039200fd222a3e254963c37d790ed51f7ad /Lib/test/test_winreg.py | |
parent | 52b8976a033073963078d8c38447c5126dfb39ce (diff) | |
download | cpython-a8c360ee76fb76902a2e2140fbb38d4b06b2d9fb.zip cpython-a8c360ee76fb76902a2e2140fbb38d4b06b2d9fb.tar.gz cpython-a8c360ee76fb76902a2e2140fbb38d4b06b2d9fb.tar.bz2 |
SF patch# 1755229 by Amaury Forgeot d'Arc: fix _winreg module and tests.
Untested.
Diffstat (limited to 'Lib/test/test_winreg.py')
-rw-r--r-- | Lib/test/test_winreg.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index 76ecd64..9984af1 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -4,7 +4,7 @@ from _winreg import * import os, sys -from test.test_support import verify, have_unicode +from test.test_support import verify test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me" @@ -13,17 +13,10 @@ test_data = [ ("String Val", "A string value", REG_SZ), ("StringExpand", "The path is %path%", REG_EXPAND_SZ), ("Multi-string", ["Lots", "of", "string", "values"], REG_MULTI_SZ), - ("Raw Data", ("binary"+chr(0)+"data"), REG_BINARY), + ("Raw Data", bytes("binary"+chr(0)+"data"), REG_BINARY), ("Big String", "x"*(2**14-1), REG_SZ), - ("Big Binary", "x"*(2**14), REG_BINARY), + ("Big Binary", b"x"*(2**14), REG_BINARY), ] -if have_unicode: - test_data+=[ - (str("Unicode Val"), str("A Unicode value"), REG_SZ,), - ("UnicodeExpand", str("The path is %path%"), REG_EXPAND_SZ), - ("Multi-unicode", [str("Lots"), str("of"), str("unicode"), str("values")], REG_MULTI_SZ), - ("Multi-mixed", [str("Unicode"), str("and"), "string", "values"],REG_MULTI_SZ), - ] def WriteTestData(root_key): # Set the default value for this key. @@ -65,7 +58,7 @@ def WriteTestData(root_key): def ReadTestData(root_key): # Check we can get default value for this key. val = QueryValue(root_key, test_key_name) - verify(val=="Default value", "Registry didn't give back the correct value") + verify(type(val) is str and val=="Default value", "Registry didn't give back the correct value") key = OpenKey(root_key, test_key_name) # Read the sub-keys |