diff --git a/poetry.lock b/poetry.lock index e645cdd..db46934 100644 --- a/poetry.lock +++ b/poetry.lock @@ -861,21 +861,6 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] -[[package]] -name = "iscc-schema" -version = "0.4.0" -description = "ISCC - JSON-LD Metadata and OpenAPI Service Descriptions" -optional = false -python-versions = ">=3.7,<4.0.0" -files = [ - {file = "iscc-schema-0.4.0.tar.gz", hash = "sha256:fdc9367cd022c2aea7b93d9c81f6496cf9260e138333ce0a314dbb932fcc76b6"}, - {file = "iscc_schema-0.4.0-py3-none-any.whl", hash = "sha256:2ab1265e526a8d6c4e1e558c7b15ff2b494923caf6dcfdc188d4a9f58130e492"}, -] - -[package.dependencies] -jcs = ">=0.2,<0.3" -pydantic = ">=1.9,<2.0" - [[package]] name = "jaraco-classes" version = "3.2.3" @@ -2394,4 +2379,4 @@ turbo = ["cython"] [metadata] lock-version = "2.0" python-versions = ">=3.7.2,<4.0" -content-hash = "4734fa6320604e4b1ad89ee8697d7ff39f341ef4739aefc6c9b8fd872fdd321a" +content-hash = "0813fc3b125848082f77087e295efe947fd5993218e6059efe5b1d6a14679325" diff --git a/pyproject.toml b/pyproject.toml index 848f638..5b8d113 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,6 @@ PyYAML = "*" coverage = "*" pytest-cov = "*" poethepoet = "*" -iscc-schema = "^0.4" bandit = "^1.7" mdformat = "*" mdformat_admon = "*" diff --git a/tests/test_code_content_audio.py b/tests/test_code_content_audio.py index 526aa6d..5e167a8 100644 --- a/tests/test_code_content_audio.py +++ b/tests/test_code_content_audio.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from iscc_schema import IsccMeta - import iscc_core.code_content_audio @@ -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 = [ diff --git a/tests/test_code_content_image.py b/tests/test_code_content_image.py index 84dd3da..03f88ef 100644 --- a/tests/test_code_content_image.py +++ b/tests/test_code_content_image.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import pytest -from iscc_schema import IsccMeta import iscc_core as ic @@ -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(): diff --git a/tests/test_code_content_mixed.py b/tests/test_code_content_mixed.py index a0030f1..f9f3e05 100644 --- a/tests/test_code_content_mixed.py +++ b/tests/test_code_content_mixed.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- import pytest -from iscc_schema import IsccMeta - import iscc_core @@ -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", + ], + } diff --git a/tests/test_code_content_text.py b/tests/test_code_content_text.py index 06b3c33..1ff5d23 100644 --- a/tests/test_code_content_text.py +++ b/tests/test_code_content_text.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- import pytest -from iscc_schema import IsccMeta - import iscc_core TEXT_A = """ @@ -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} diff --git a/tests/test_code_content_video.py b/tests/test_code_content_video.py index 03bf97d..4bfff39 100644 --- a/tests/test_code_content_video.py +++ b/tests/test_code_content_video.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -from iscc_schema import IsccMeta - import iscc_core @@ -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"} diff --git a/tests/test_code_data.py b/tests/test_code_data.py index 875dca6..c495b51 100644 --- a/tests/test_code_data.py +++ b/tests/test_code_data.py @@ -1,8 +1,5 @@ from io import BytesIO import random - -from iscc_schema import IsccMeta - import iscc_core @@ -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"} diff --git a/tests/test_code_instance.py b/tests/test_code_instance.py index 94c30bf..3bbf777 100644 --- a/tests/test_code_instance.py +++ b/tests/test_code_instance.py @@ -1,5 +1,4 @@ from io import BytesIO -from iscc_schema import IsccMeta import iscc_core @@ -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, + } diff --git a/tests/test_code_meta.py b/tests/test_code_meta.py index 59032b8..88a9576 100644 --- a/tests/test_code_meta.py +++ b/tests/test_code_meta.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import pytest -from iscc_schema import IsccMeta import iscc_core as ic @@ -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(): @@ -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(): diff --git a/tests/test_iscc_code.py b/tests/test_iscc_code.py index 4a8816d..6f40006 100644 --- a/tests/test_iscc_code.py +++ b/tests/test_iscc_code.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import pytest -from iscc_schema import IsccMeta import iscc_core as ic @@ -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(): @@ -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():