Files
python-teos/test/pisa/unit/test_blob.py
Sergi Delgado Segura fffcb39124 Enables stdout for unit tests
By default pytests does not capture stdout, but it can do with -s. It is nice to have the option to verbose the tests if needed
2019-12-17 17:22:40 +01:00

20 lines
443 B
Python

from binascii import unhexlify
from pisa import c_logger
from apps.cli.blob import Blob
from test.pisa.unit.conftest import get_random_value_hex
def test_init_blob():
data = get_random_value_hex(64)
blob = Blob(data)
assert isinstance(blob, Blob)
# Wrong data
try:
Blob(unhexlify(get_random_value_hex(64)))
assert False, "Able to create blob with wrong data"
except ValueError:
assert True