Focus on Iterator protocol - tests passing!
Too much naming copy/pasta will probably confuse Python programmers when we have generator/iterators and I suppose we have streams but that is just so generic that it won't help. So, better make it explicit that this is an iterator. It also seems to the fit the usage of the other implementors.
This commit is contained in:
@ -5,18 +5,18 @@ import pytest
|
||||
|
||||
@pytest.fixture
|
||||
def leaf():
|
||||
def _leaf(node):
|
||||
return hashlib.sha256(leaf.data).hexdigest()
|
||||
def _leaf(node, roots=None):
|
||||
return hashlib.sha256(node.data).hexdigest()
|
||||
|
||||
return _leaf
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def parent():
|
||||
def _parent(left, right):
|
||||
def _parent(first, second):
|
||||
sha256 = hashlib.sha256()
|
||||
sha256.update(left)
|
||||
sha256.update(right)
|
||||
sha256.update(first.data)
|
||||
sha256.update(second.data)
|
||||
return sha256.hexdigest()
|
||||
|
||||
return _parent
|
||||
|
Reference in New Issue
Block a user