Another pass: rough shape of tree and tests
It isn't working yet, the tests don't pass. But it is on the way!
This commit is contained in:
22
test/conftest.py
Normal file
22
test/conftest.py
Normal file
@ -0,0 +1,22 @@
|
||||
import hashlib
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def leaf():
|
||||
def _leaf(node):
|
||||
return hashlib.sha256(leaf.data).hexdigest()
|
||||
|
||||
return _leaf
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def parent():
|
||||
def _parent(left, right):
|
||||
sha256 = hashlib.sha256()
|
||||
sha256.update(left)
|
||||
sha256.update(right)
|
||||
return sha256.hexdigest()
|
||||
|
||||
return _parent
|
Reference in New Issue
Block a user