FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
validators/tests/test_sha512.py at master · pythonthings/validators · GitHub
pythonthings
validators
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
validators
/
tests
/
test_sha512.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (32 loc) · 1.17 KB
Breadcrumbs
validators
/
tests
/
test_sha512.py
Copy path
File metadata and controls
37 lines (32 loc) · 1.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
import
pytest
import
validators
@
pytest
.
mark
.
parametrize
(
'value'
, [
(
'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d'
'13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
),
(
'CF83E1357EEFB8BDF1542850D66D8007D620E4050B5715DC83F4A921D36CE9CE47D0D'
'13C5D85F2B0FF8318D2877EEC2F63B931BD47417A81A538327AF927DA3E'
)
])
def
test_returns_true_on_valid_sha512
(
value
):
assert
validators
.
sha512
(
value
)
@
pytest
.
mark
.
parametrize
(
'value'
, [
(
'zf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d'
'13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
),
(
'cf8357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c'
'5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
),
(
'cf8aaaa3e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce4'
'7d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
)
])
def
test_returns_failed_validation_on_invalid_sha512
(
value
):
result
=
validators
.
sha512
(
value
)
assert
isinstance
(
result
,
validators
.
ValidationFailure
)
Back
|
FazBrowse Home
|
New Git URL