mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-08 16:14:28 +01:00
Moves EncryptedBlob to common
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import json
|
||||
import binascii
|
||||
from time import sleep
|
||||
from riemann.tx import Tx
|
||||
|
||||
from pisa import config
|
||||
from pisa import HOST, PORT
|
||||
from apps.cli import wt_cli
|
||||
from apps.cli.blob import Blob
|
||||
from apps.cli import config as cli_conf
|
||||
from common.blob import Blob
|
||||
|
||||
import common.cryptographer
|
||||
from common.logger import Logger
|
||||
|
||||
@@ -11,7 +11,7 @@ from cryptography.hazmat.backends import default_backend
|
||||
from cryptography.hazmat.primitives.asymmetric import ec
|
||||
from cryptography.hazmat.primitives import serialization
|
||||
|
||||
from apps.cli.blob import Blob
|
||||
from common.blob import Blob
|
||||
from pisa.responder import TransactionTracker
|
||||
from pisa.tools import bitcoin_cli
|
||||
from pisa.db_manager import DBManager
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
from binascii import unhexlify
|
||||
|
||||
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
|
||||
@@ -1,16 +0,0 @@
|
||||
from pisa.encrypted_blob import EncryptedBlob
|
||||
from test.pisa.unit.conftest import get_random_value_hex
|
||||
|
||||
|
||||
def test_init_encrypted_blob():
|
||||
# No much to test here, basically that the object is properly created
|
||||
data = get_random_value_hex(64)
|
||||
assert EncryptedBlob(data).data == data
|
||||
|
||||
|
||||
def test_equal():
|
||||
data = get_random_value_hex(64)
|
||||
e_blob1 = EncryptedBlob(data)
|
||||
e_blob2 = EncryptedBlob(data)
|
||||
|
||||
assert e_blob1 == e_blob2 and id(e_blob1) != id(e_blob2)
|
||||
Reference in New Issue
Block a user