From 338b390b85e3135792bc74e7862e1bb6911ea3ef Mon Sep 17 00:00:00 2001 From: Tobias Hilbig Date: Fri, 19 Apr 2024 14:05:22 +0200 Subject: [PATCH] Constrict test_02_trust_anchor_intermediary even more --- .../test_02_trust_anchor_intermediary.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/spid_cie_oidc/authority/tests/test_02_trust_anchor_intermediary.py b/spid_cie_oidc/authority/tests/test_02_trust_anchor_intermediary.py index 587689fb..aa33436f 100644 --- a/spid_cie_oidc/authority/tests/test_02_trust_anchor_intermediary.py +++ b/spid_cie_oidc/authority/tests/test_02_trust_anchor_intermediary.py @@ -138,13 +138,24 @@ def test_trust_chain_valid_with_intermediary(self, mocked): _p2 = unpad_jwt_payload(tc_ser[2]) _p3 = unpad_jwt_payload(tc_ser[3]) + # Entity configurations self.assertEqual(_p0['iss'], _p0['sub']) + self.assertEqual(_p3['iss'], _p3['sub']) + + # Entity statements + self.assertNotEqual(_p1['iss'], _p1['sub']) + self.assertNotEqual(_p2['iss'], _p2['sub']) + + # Chain consistency (positive) self.assertEqual(_p0['iss'], _p1['sub']) + self.assertEqual(_p1['iss'], _p2['sub']) + self.assertEqual(_p2['iss'], _p3['sub']) + + # Chain consistency (negative) + self.assertNotEqual(_p1['iss'], _p0['sub']) self.assertNotEqual(_p2['iss'], _p1['sub']) - self.assertNotEqual(_p2['iss'], _p2['sub']) - self.assertEqual(_p3['sub'], _p2['iss']) - self.assertEqual(_p3['iss'], _p3['sub']) - + self.assertNotEqual(_p3['iss'], _p2['sub']) + dumps = dumps_statements_from_trust_chain_to_db(trust_chain) self.assertTrue(isinstance(dumps, list) and len(dumps) == 5)