Skip to content

Commit

Permalink
Remove iscc-schema from test dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Dec 15, 2023
1 parent 70056c7 commit 3f020c6
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 52 deletions.
17 changes: 1 addition & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ PyYAML = "*"
coverage = "*"
pytest-cov = "*"
poethepoet = "*"
iscc-schema = "^0.4"
bandit = "^1.7"
mdformat = "*"
mdformat_admon = "*"
Expand Down
8 changes: 3 additions & 5 deletions tests/test_code_content_audio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from iscc_schema import IsccMeta

import iscc_core.code_content_audio


Expand Down Expand Up @@ -79,9 +77,9 @@ def test_gen_audio_code():
}


def test_cen_audio_code_schema_conformance():
iscc_obj = IsccMeta(**iscc_core.gen_audio_code_v0(CHROMA_VECTOR))
assert iscc_obj.iscc == "ISCC:EIAWUJFCEZZOJYVD"
def test_gen_audio_code_schema_conformance():
iscc_obj = iscc_core.gen_audio_code_v0(CHROMA_VECTOR)
assert iscc_obj == {"iscc": "ISCC:EIAWUJFCEZZOJYVD"}


CHROMA_VECTOR = [
Expand Down
5 changes: 2 additions & 3 deletions tests/test_code_content_image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import pytest
from iscc_schema import IsccMeta
import iscc_core as ic


Expand Down Expand Up @@ -87,8 +86,8 @@ def test_dct_range():


def test_gen_image_code_schema_conformance():
iscc_obj = IsccMeta(**ic.gen_image_code_v0(IMG_SAMPLE_PIXELS))
assert iscc_obj.iscc == "ISCC:EEA4GQZQTY6J5DTH"
iscc_obj = ic.gen_image_code_v0(IMG_SAMPLE_PIXELS)
assert iscc_obj == {"iscc": "ISCC:EEA4GQZQTY6J5DTH"}


def test_soft_hash_image_v0_larger_256_raises():
Expand Down
12 changes: 8 additions & 4 deletions tests/test_code_content_mixed.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
import pytest
from iscc_schema import IsccMeta

import iscc_core


Expand Down Expand Up @@ -52,5 +50,11 @@ def test_gen_mixed_code_schema_conformance():
tc_long = iscc_core.gen_text_code_v0("Hello World", bits=256)["iscc"]
tc_short = iscc_core.gen_text_code_v0("Short Text-Code", bits=64)["iscc"]
codes = tc_long, tc_short
iscc_obj = IsccMeta(**iscc_core.gen_mixed_code_v0(codes=codes))
assert iscc_obj.iscc == "ISCC:EQASBPL7XH763357"
iscc_obj = iscc_core.gen_mixed_code_v0(codes=codes)
assert iscc_obj == {
"iscc": "ISCC:EQASBPL7XH763357",
"parts": [
"ISCC:EADSKDNZNYGUUF5AMFEJLZ5P66CP5YKCOA3X7F36RWE4CIRCBTUWXYY",
"ISCC:EAA3265Q67Q27P7F",
],
}
6 changes: 2 additions & 4 deletions tests/test_code_content_text.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
import pytest
from iscc_schema import IsccMeta

import iscc_core

TEXT_A = """
Expand Down Expand Up @@ -92,5 +90,5 @@ def test_code_text_empty():


def test_gen_text_code_schema_conformance():
iscc_obj = IsccMeta(**iscc_core.gen_text_code_v0("Hello World"))
assert iscc_obj.iscc == "ISCC:EAASKDNZNYGUUF5A"
iscc_obj = iscc_core.gen_text_code_v0("Hello World")
assert iscc_obj == {"iscc": "ISCC:EAASKDNZNYGUUF5A", "characters": 10}
6 changes: 2 additions & 4 deletions tests/test_code_content_video.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from iscc_schema import IsccMeta

import iscc_core


Expand Down Expand Up @@ -64,5 +62,5 @@ def test_gen_video_code_schema_confromance():
fa = tuple([0, 1, 0, 2, 1] * 76)
fb = tuple([1, 2, 1, 0, 2] * 76)
frame_vectors = [fa, fb]
iscc_obj = IsccMeta(**iscc_core.gen_video_code_v0(frame_vectors))
assert iscc_obj.iscc == "ISCC:EMAZEMGSDFIB4AHU"
iscc_obj = iscc_core.gen_video_code_v0(frame_vectors)
assert iscc_obj == {"iscc": "ISCC:EMAZEMGSDFIB4AHU"}
7 changes: 2 additions & 5 deletions tests/test_code_data.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
from io import BytesIO
import random

from iscc_schema import IsccMeta

import iscc_core


Expand Down Expand Up @@ -90,5 +87,5 @@ def test_DataHasher(static_bytes):


def test_gen_data_code_schema_conformance():
iscc_obj = IsccMeta(**iscc_core.gen_data_code_v0(BytesIO(b"\xff")))
assert iscc_obj.iscc == "ISCC:GAAV5ZIQC4WCUBIK"
iscc_obj = iscc_core.gen_data_code_v0(BytesIO(b"\xff"))
assert iscc_obj == {"iscc": "ISCC:GAAV5ZIQC4WCUBIK"}
9 changes: 6 additions & 3 deletions tests/test_code_instance.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from io import BytesIO
from iscc_schema import IsccMeta
import iscc_core


Expand Down Expand Up @@ -50,5 +49,9 @@ def test_gen_code_instance_hello_world_256():


def test_gen_instance_code_schema_conformance():
iscc_obj = IsccMeta(**iscc_core.gen_instance_code_v0(BytesIO(b"hello world")))
assert iscc_obj.iscc == "ISCC:IAA5OSMB56TQUDEI"
iscc_obj = iscc_core.gen_instance_code_v0(BytesIO(b"hello world"))
assert iscc_obj == {
"iscc": "ISCC:IAA5OSMB56TQUDEI",
"datahash": "1e20d74981efa70a0c880b8d8c1985d075dbcbf679b99a5f9914e5aaf96b831a9e24",
"filesize": 11,
}
4 changes: 0 additions & 4 deletions tests/test_code_meta.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import pytest
from iscc_schema import IsccMeta
import iscc_core as ic


Expand Down Expand Up @@ -42,7 +41,6 @@ def test_gen_meta_code_meta_dict():
"meta": "data:application/json;base64,eyJoZWxsbyI6Im1ldGFkYXRhIn0=",
"metahash": "1e200c6f9a94eb08835a957ffc9a7c80cf3fb54d1c6a8f13a41a6573a57ba146b0d2",
}
assert IsccMeta(**m).iscc == "ISCC:AAAWKLHFXMFCA2OC"


def test_gen_meta_code_meta_bytes():
Expand Down Expand Up @@ -104,8 +102,6 @@ def test_gen_meta_code_v0_interleaved():
"metahash": "1e2041f8394111eb713a22165c46c90ab8f0fd9399c92028fd6d288944b23ff5bf76",
"name": "Hello",
}
assert IsccMeta(**ma).iscc == "ISCC:AAAWKLHFXM75OAMK"
assert IsccMeta(**mb).iscc == "ISCC:AAAWKLHFXNSF7NNE"


def test_gen_meta_code_v0_metadata_raises():
Expand Down
3 changes: 0 additions & 3 deletions tests/test_iscc_code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import pytest
from iscc_schema import IsccMeta
import iscc_core as ic


Expand Down Expand Up @@ -51,7 +50,6 @@ def test_gen_iscc_code_v0_no_meta_content_128():
icode = ic.gen_iscc_code_v0([DID_64, IID_256])
assert icode == {"iscc": "ISCC:KUAAQICFKJYKY4KUMQV6B6THIBBUG"}
assert ic.iscc_explain(icode["iscc"]) == "ISCC-SUM-V0-DI-0820455270ac7154642be0fa67404343"
assert IsccMeta(**icode).iscc == "ISCC:KUAAQICFKJYKY4KUMQV6B6THIBBUG"


def test_gen_iscc_code_v0_ordering():
Expand All @@ -61,7 +59,6 @@ def test_gen_iscc_code_v0_ordering():
ic.iscc_explain(icode["iscc"])
== "ISCC-TEXT-V0-MCDI-87dedce74b3c353b16257380a960347a5a8ba362526c2b3c642be0fa67404343"
)
assert IsccMeta(**icode).iscc == "ISCC:KACYPXW445FTYNJ3CYSXHAFJMA2HUWULUNRFE3BLHRSCXYH2M5AEGQY"


def test_gen_iscc_code_v0_insufficient_codes_raises():
Expand Down

0 comments on commit 3f020c6

Please sign in to comment.