1
1
from unittest import TestCase
2
2
3
3
from pyntegrity .core import detect_hash_algo
4
- from pyntegrity .core import validate_hash_str
4
+ from pyntegrity .core import validate_checksum_str
5
5
6
6
from pyntegrity .exceptions import HashStrNotValidException
7
7
from pyntegrity .exceptions import HashAlgorithmNotSupportedException
@@ -17,30 +17,30 @@ def test_detect_hash_algo_ok(self):
17
17
self .assertEqual (hash_name , "sha256" )
18
18
19
19
def test_detect_hash_algo_nok (self ):
20
- invalid_hash_str = "6545ed"
20
+ invalid_checksum_str = "6545ed"
21
21
with self .assertRaises (HashAlgorithmNotSupportedException ):
22
- detect_hash_algo (invalid_hash_str )
22
+ detect_hash_algo (invalid_checksum_str )
23
23
24
24
25
25
class TestValidateHashStr (TestCase ):
26
- def test_validate_hash_str_md5_ok (self ):
26
+ def test_validate_checksum_str_md5_ok (self ):
27
27
valid_md5 = "098f6bcd4621d373cade4e832627b4f6"
28
- self .assertTrue (validate_hash_str (valid_md5 ))
28
+ self .assertTrue (validate_checksum_str (valid_md5 ))
29
29
30
- def test_validate_hash_str_md5_nok (self ):
30
+ def test_validate_checksum_str_md5_nok (self ):
31
31
invalid_md5 = "098f6bcd4621d373xade4e832627b4f6"
32
32
with self .assertRaises (HashStrNotValidException ):
33
- validate_hash_str (invalid_md5 )
33
+ validate_checksum_str (invalid_md5 )
34
34
35
- def test_validate_hash_str_sha256_ok (self ):
35
+ def test_validate_checksum_str_sha256_ok (self ):
36
36
valid_sha256 = (
37
37
"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
38
38
)
39
- self .assertTrue (validate_hash_str (valid_sha256 ))
39
+ self .assertTrue (validate_checksum_str (valid_sha256 ))
40
40
41
- def test_validate_hash_str_sha256_nok (self ):
41
+ def test_validate_checksum_str_sha256_nok (self ):
42
42
invalid_sha256 = (
43
43
"9f86d081884x7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
44
44
)
45
45
with self .assertRaises (HashStrNotValidException ):
46
- validate_hash_str (invalid_sha256 )
46
+ validate_checksum_str (invalid_sha256 )
0 commit comments