diff --git a/cert_schema/context_urls.json b/cert_schema/context_urls.json index ff0e680..666e5b5 100644 --- a/cert_schema/context_urls.json +++ b/cert_schema/context_urls.json @@ -15,6 +15,9 @@ "BLOCKCERTS_V3_1_CONTEXT": "https://w3id.org/blockcerts/schema/3.1/context.json", "BLOCKCERTS_V3_1_CANONICAL_CONTEXT": "https://w3id.org/blockcerts/v3.1", "BLOCKCERTS_ORG_V3_1_CONTEXT": "https://www.blockcerts.org/schema/3.1/context.json", + "BLOCKCERTS_V3_2_CONTEXT": "https://w3id.org/blockcerts/schema/3.2/context.json", + "BLOCKCERTS_V3_2_CANONICAL_CONTEXT": "https://w3id.org/blockcerts/v3.2", + "BLOCKCERTS_ORG_V3_2_CONTEXT": "https://www.blockcerts.org/schema/3.2/context.json", "MERKLE_PROOF_2019_CONTEXT": "https://w3id.org/security/suites/merkle-2019/v1", "CHAINED_PROOF_2021_CONTEXT": "https://w3id.org/security/suites/chained-2021/v1", "STATUS_LIST_2021_CONTEXT": "https://w3id.org/vc/status-list/2021/v1", diff --git a/cert_schema/context_urls.py b/cert_schema/context_urls.py index 7009439..7135453 100644 --- a/cert_schema/context_urls.py +++ b/cert_schema/context_urls.py @@ -71,6 +71,22 @@ def v3_1_all(self): self.v3_1_blockcerts_org() ] + def v3_2(self): + return self.CONTEXT_URLS['BLOCKCERTS_V3_2_CONTEXT'] + + def v3_2_canonical(self): + return self.CONTEXT_URLS['BLOCKCERTS_V3_2_CANONICAL_CONTEXT'] + + def v3_2_blockcerts_org(self): + return self.CONTEXT_URLS['BLOCKCERTS_ORG_V3_2_CONTEXT'] + + def v3_2_all(self): + return [ + self.v3_2(), + self.v3_2_canonical(), + self.v3_2_blockcerts_org() + ] + def open_badge(self): return self.CONTEXT_URLS['OPEN_BADGES_V2_CONTEXT'] diff --git a/tests/test_context_urls.py b/tests/test_context_urls.py index 4eec086..3b807f8 100644 --- a/tests/test_context_urls.py +++ b/tests/test_context_urls.py @@ -87,6 +87,26 @@ def test_v3_1_all(self): 'https://www.blockcerts.org/schema/3.1/context.json' ]) + def test_v3_2(self): + output = self.instance.v3_2() + self.assertTrue(output == 'https://w3id.org/blockcerts/schema/3.2/context.json') + + def test_v3_2_canonical(self): + output = self.instance.v3_2_canonical() + self.assertTrue(output == 'https://w3id.org/blockcerts/v3.2') + + def test_v3_2_blockcerts_org(self): + output = self.instance.v3_2_blockcerts_org() + self.assertTrue(output == 'https://www.blockcerts.org/schema/3.2/context.json') + + def test_v3_2_all(self): + output = self.instance.v3_2_all() + self.assertEqual(output, [ + 'https://w3id.org/blockcerts/schema/3.2/context.json', + 'https://w3id.org/blockcerts/v3.2', + 'https://www.blockcerts.org/schema/3.2/context.json' + ]) + def test_open_badge(self): output = self.instance.open_badge() self.assertTrue(output == 'https://openbadgespec.org/v2/context.json')