Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
152e3f08
Kaydet (Commit)
152e3f08
authored
Tem 28, 2000
tarafından
Mark Hammond
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Was quite broken and incomplete. Now passes the test suite, but is still incomplete.
üst
4e80bb55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
test_winreg2.py
Lib/test/test_winreg2.py
+14
-5
No files found.
Lib/test/test_winreg2.py
Dosyayı görüntüle @
152e3f08
from
winreg
import
hives
,
createKey
,
openKey
,
flags
,
deleteKey
,
regtypes
import
sys
,
traceback
import
time
import
array
def
testHives
():
hivenames
=
[
"HKEY_CLASSES_ROOT"
,
"HKEY_CURRENT_USER"
,
"HKEY_LOCAL_MACHINE"
,
...
...
@@ -127,6 +128,13 @@ def testSetStringValue():
del
hives
[
"HKCU"
]
.
getValues
()[
"Blah"
]
assert
not
hives
[
"HKCU"
]
.
getValues
()
.
has_key
(
"Blah"
)
# Ensure Unicode works as we expect
hives
[
"HKCU"
]
.
setValue
(
u"Blah"
,
u"abc"
)
assert
hives
[
"HKCU"
]
.
getValueData
(
"Blah"
)
==
"abc"
assert
hives
[
"HKCU"
]
.
getValues
()
.
has_key
(
u"Blah"
)
del
hives
[
"HKCU"
]
.
getValues
()[
u"Blah"
]
assert
not
hives
[
"HKCU"
]
.
getValues
()
.
has_key
(
u"Blah"
)
def
testDeleteValue
():
hives
[
"HKCU"
]
.
setValue
(
"Blah"
,
"abc"
)
assert
hives
[
"HKCU"
]
.
getValues
()
.
has_key
(
"Blah"
)
...
...
@@ -175,17 +183,18 @@ def testSetIntValue():
key
.
getValues
()[
"abcd"
]
=
(
5
,
regtypes
[
"REG_DWORD"
])
assert
key
.
getValues
()[
"abcd"
][
1
]
==
5
key
.
deleteValue
(
"abcd"
)
key
.
deleteKey
(
"HKLM
\\
Software
\\
a
\\
b"
)
key
.
deleteKey
(
"HKLM
\\
Software
\\
a"
)
deleteKey
(
"HKLM
\\
Software
\\
a
\\
b"
)
deleteKey
(
"HKLM
\\
Software
\\
a"
)
def
testSetBinaryValue
():
key
=
createKey
(
"HKLM
\\
Software
\\
a
\\
b"
)
key
.
setValue
(
"abcd"
,
array
.
array
(
'c'
,
"PPPPPPPPPPPPPPP"
)
)
key
.
setValue
(
"abcde"
,
array
.
array
(
'c'
,
"PPPPPPPPPPPPPPP"
),
regtypes
[
"REG_BINARY"
]
)
assert
key
.
getValues
()[
"abcd"
]
==
key
.
getValues
()[
"abcde"
]
key
.
deleteKey
(
"HKLM
\\
Software
\\
a
\\
b"
)
key
.
deleteKey
(
"HKLM
\\
Software
\\
a"
)
assert
key
.
getValues
()[
"abcd"
][
1
]
==
key
.
getValues
()[
"abcde"
][
1
]
key
=
None
# Remove our reference.
deleteKey
(
"HKLM
\\
Software
\\
a
\\
b"
)
deleteKey
(
"HKLM
\\
Software
\\
a"
)
def
testSetNone
():
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment