From 17d18f2e2c71e55f1a9e15a54add5cf4a08ae34d Mon Sep 17 00:00:00 2001 From: Gavin Peacock Date: Tue, 8 Oct 2024 17:16:00 -0700 Subject: [PATCH] fix: fixes bug in from_manifest_and_stream. Renames unit_tests so it will run with pytest. --- c2pa/c2pa_api/c2pa_api.py | 2 +- tests/{unit_tests.py => test_unit_tests.py} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename tests/{unit_tests.py => test_unit_tests.py} (97%) diff --git a/c2pa/c2pa_api/c2pa_api.py b/c2pa/c2pa_api/c2pa_api.py index 26fecd86..ec097e92 100644 --- a/c2pa/c2pa_api/c2pa_api.py +++ b/c2pa/c2pa_api/c2pa_api.py @@ -39,7 +39,7 @@ class Reader(api.Reader): def __init__(self, format, stream, manifest_data=None): super().__init__() if manifest_data is not None: - self.from_manifest_data_and_stream(format, manifest_data, stream) + self.from_manifest_data_and_stream(manifest_data, format, stream) else: self.from_stream(format, C2paStream(stream)) diff --git a/tests/unit_tests.py b/tests/test_unit_tests.py similarity index 97% rename from tests/unit_tests.py rename to tests/test_unit_tests.py index e3c8c940..583eecc7 100644 --- a/tests/unit_tests.py +++ b/tests/test_unit_tests.py @@ -121,7 +121,7 @@ def test_remote_sign(self): output = io.BytesIO(bytearray()) manifest_data = builder.sign(TestBuilder.signer, "image/jpeg", file, output) output.seek(0) - reader = Reader.from_manifest_data_and_stream(manifest_data, "image/jpeg", output) + reader = Reader("image/jpeg", output, manifest_data) self.assertIn("Python Test", reader.json()) if __name__ == '__main__':