Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py3 the test #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tests/test_bf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from array import array
from base64 import b64encode
import six
import _pybloof


@@ -23,9 +24,15 @@ def test_long_pybloof():
assert 1015 in dmc
assert 2015 not in dmc

origin = b64encode(dmc.to_byte_array().tostring())
if six.PY3:
origin = b64encode(dmc.to_byte_array().tobytes())
else:
origin = b64encode(dmc.to_byte_array().tostring())
dmc_2 = _pybloof.LongBloomFilter.from_byte_array(dmc.to_byte_array())
clone = b64encode(dmc_2.to_byte_array().tostring())
if six.PY3:
clone = b64encode(dmc_2.to_byte_array().tobytes())
else:
clone = b64encode(dmc_2.to_byte_array().tostring())
assert origin == clone

assert 1015 in dmc_2