Skip to content

Commit

Permalink
Remove v0 module.
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Mar 19, 2022
1 parent 3a4ba87 commit 365f420
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
2 changes: 0 additions & 2 deletions iscc_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
__version__ = "0.2.4"
from iscc_core.options import core_opts, conformant_options
from iscc_core import v0

# Import full api to toplevel

from iscc_core.conformance import *
from iscc_core.constants import *

Expand Down
2 changes: 1 addition & 1 deletion iscc_core/conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def conformance_testdata():
with open(TEST_DATA, "rb") as stream:
data = json.load(stream)
for func_name, tests in data.items():
func_obj = getattr(ic.v0, func_name)
func_obj = getattr(ic, func_name)
for test_name, test_values in tests.items():

# Convert stream and bytes test values
Expand Down
13 changes: 0 additions & 13 deletions iscc_core/v0.py

This file was deleted.

12 changes: 6 additions & 6 deletions tests/test_code_flake.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ def test_gen_flake_code():


def test_gen_flake_code_v0():
flake = ic.v0.gen_flake_code_v0()["iscc"]
flake = ic.gen_flake_code_v0()["iscc"]
assert len(flake) == 21
assert flake.startswith("ISCC:OAA")


def test_uid_flake_v0():
assert ic.v0.uid_flake_v0(0).hex().startswith("000000000000")
assert ic.uid_flake_v0(0).hex().startswith("000000000000")
ts = 1644789890.9664667
assert ic.v0.uid_flake_v0(ts).hex().startswith("017ef51dff96")
assert ic.uid_flake_v0(ts).hex().startswith("017ef51dff96")


def test_uid_flake_v0_raises():
with pytest.raises(ValueError):
ic.v0.uid_flake_v0(bits=31)
ic.uid_flake_v0(bits=31)
with pytest.raises(ValueError):
ic.v0.uid_flake_v0(bits=257)
ic.uid_flake_v0(bits=257)
with pytest.raises(ValueError):
ic.v0.uid_flake_v0(bits=65)
ic.uid_flake_v0(bits=65)


def test_Flake_init():
Expand Down

0 comments on commit 365f420

Please sign in to comment.