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
db4f255c
Kaydet (Commit)
db4f255c
authored
Kas 18, 2006
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Expand checking in test_sha
üst
bba003ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
test_sha.py
Lib/test/test_sha.py
+15
-1
No files found.
Lib/test/test_sha.py
Dosyayı görüntüle @
db4f255c
...
@@ -11,9 +11,23 @@ from test import test_support
...
@@ -11,9 +11,23 @@ from test import test_support
class
SHATestCase
(
unittest
.
TestCase
):
class
SHATestCase
(
unittest
.
TestCase
):
def
check
(
self
,
data
,
digest
):
def
check
(
self
,
data
,
digest
):
computed
=
sha
.
new
(
data
)
.
hexdigest
()
# Check digest matches the expected value
obj
=
sha
.
new
(
data
)
computed
=
obj
.
hexdigest
()
self
.
assert_
(
computed
==
digest
)
self
.
assert_
(
computed
==
digest
)
# Verify that the value doesn't change between two consecutive
# digest operations.
computed_again
=
obj
.
hexdigest
()
self
.
assert_
(
computed
==
computed_again
)
# Check hexdigest() output matches digest()'s output
digest
=
obj
.
digest
()
hexd
=
""
for
c
in
digest
:
hexd
+=
'
%02
x'
%
ord
(
c
)
self
.
assert_
(
computed
==
hexd
)
def
test_case_1
(
self
):
def
test_case_1
(
self
):
self
.
check
(
"abc"
,
self
.
check
(
"abc"
,
"a9993e364706816aba3e25717850c26c9cd0d89d"
)
"a9993e364706816aba3e25717850c26c9cd0d89d"
)
...
...
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