Files
python-teos/test/common/unit/test_tools.py
Sergi Delgado Segura 74080bf104 Deletes test file
2019-12-16 13:03:17 +01:00

13 lines
499 B
Python

from common.tools import check_sha256_hex_format
from test.common.unit.conftest import get_random_value_hex
def test_check_sha256_hex_format():
# Only 32-byte hex encoded strings should pass the test
wrong_inputs = [None, str(), 213, 46.67, dict(), "A" * 63, "C" * 65, bytes(), get_random_value_hex(31)]
for wtype in wrong_inputs:
assert check_sha256_hex_format(wtype) is False
for v in range(100):
assert check_sha256_hex_format(get_random_value_hex(32)) is True