Files
python-teos/test/pisa/unit/test_blob.py
Sergi Delgado Segura 61663e89d7 Refactors tests folder to separate different modules
Each module has a different folder and they do not share methods now. At some point they should be split in different repos
2019-12-16 11:26:51 +01:00

22 lines
469 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
c_logger.disabled = True
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