Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
db4f255c
Commit
db4f255c
authored
Nov 18, 2006
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand checking in test_sha
parent
bba003ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
Lib/test/test_sha.py
Lib/test/test_sha.py
+15
-1
No files found.
Lib/test/test_sha.py
View file @
db4f255c
...
...
@@ -11,9 +11,23 @@ from test import test_support
class
SHATestCase
(
unittest
.
TestCase
):
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
)
# 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
+=
'%02x'
%
ord
(
c
)
self
.
assert_
(
computed
==
hexd
)
def
test_case_1
(
self
):
self
.
check
(
"abc"
,
"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