diff --git a/tests/test_api.py b/tests/test_api.py index 8f6f6c9e37..125bf64386 100755 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -639,6 +639,13 @@ def test_targetfile_from_file(self) -> None: with self.assertRaises(ValueError): TargetFile.from_file(file_path, file_path, ["123"]) + def test_targetfile_custom(self) -> None: + # Test creating TargetFile and accessing custom. + targetfile = TargetFile( + 100, {"sha256": "abc"}, "file.txt", {"custom": "foo"} + ) + self.assertEqual(targetfile.custom, "foo") + def test_targetfile_from_data(self) -> None: data = b"Inline test content" target_file_path = os.path.join( diff --git a/tests/test_metadata_serialization.py b/tests/test_metadata_serialization.py index 3714eec00c..497eb1768d 100644 --- a/tests/test_metadata_serialization.py +++ b/tests/test_metadata_serialization.py @@ -214,6 +214,7 @@ def test_invalid_root_serialization(self, test_case_data: str) -> None: invalid_metafiles: utils.DataSet = { "wrong length type": '{"version": 1, "length": "a", "hashes": {"sha256" : "abc"}}', + "version 0": '{"version": 0, "length": 1, "hashes": {"sha256" : "abc"}}', "length 0": '{"version": 1, "length": 0, "hashes": {"sha256" : "abc"}}', "length below 0": '{"version": 1, "length": -1, "hashes": {"sha256" : "abc"}}', "empty hashes dict": '{"version": 1, "length": 1, "hashes": {}}',