From 54d1dcee7bd58f6601db8039f5abd44bd47fd9c9 Mon Sep 17 00:00:00 2001 From: Guzz-T Date: Mon, 9 Nov 2026 23:12:13 +0100 Subject: [PATCH] Add a test that checks if all successors are correctly defined --- tests/test_definition_list.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_definition_list.py b/tests/test_definition_list.py index a5d46332..4482601d 100644 --- a/tests/test_definition_list.py +++ b/tests/test_definition_list.py @@ -233,6 +233,16 @@ def test_version(self): assert parsed is not None, \ f"Version must be a valid version requirement instead of {version}: {definition}" + def test_successor(self): + for definition in self.definitions: + if Keys.SUCCESSOR in definition: + successor = definition[Keys.SUCCESSOR] + found = False + for d in self.definitions: + if definition is not d and Keys.NAMES in d: + found |= (d[Keys.NAMES][0].lower() == successor.lower()) + assert found, \ + f"The successor {successor} must be defined correctly as the preferred name of another field: {definition}" ############################################################################### # Tests