示例#1
0
 def test_04c_invalid_md5_bad_characters(self):
     """
     Verify that an md5 that contains non-alphanumerics is not accepted.
     """
     check = ["-", ".", "+"]
     allowed = []
     for item in check:
         test = f"001122334455667{item}8899AABBCCDDEEFF"
         if validate_md5sum(test):
             allowed.append(item)
     assert len(allowed) == 0, f"Invalid md5 characters accepted: {allowed}"
示例#2
0
 def test_04d_invalid_md5_invalid_alphabetic(self):
     """
     Verify that an md5 that contains other than 0-F is rejected.
     """
     test = "00112233445566778899AABBCCDDggXX"
     assert not validate_md5sum(test), "md5 with invalid alphabetics accepted!"
示例#3
0
 def test_04b_invalid_md5_long(self):
     """
     Verify that an md5 that is too long is not accepted.
     """
     test = "00112233445566778899AABBCCDDEEFF0"  # long 1 char
     assert not validate_md5sum(test), "Long md5 accepted!"
示例#4
0
 def test_04a_invalid_md5_short(self):
     """
     Verify that an md5 that is too short is not accepted.
     """
     test = "00112233445566778899AABBCCDDEEF"  # short 1 char
     assert not validate_md5sum(test), "Short md5 accepted!"
示例#5
0
 def test_03b_validate_md5_lower(self):
     """
     Verify that an valid md5 is accepted with lower case a-f.
     """
     test = "00112233445566778899aabbccddeeff"
     assert validate_md5sum(test)
示例#6
0
 def test_03a_validate_md5_upper(self):
     """
     Verify that an valid md5 is accepted with upper case A-F.
     """
     test = "00112233445566778899AABBCCDDEEFF"
     assert validate_md5sum(test)