File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ from pyeudiw .trust .anchors_loader import AnchorsLoader
2+ from pyeudiw .storage .db_engine import DBEngine
3+ from pyeudiw .storage .exceptions import EntryNotFound
4+ from pyeudiw .tests .settings import CONFIG
5+ from pyeudiw .tests .federation .base import ta_ec_signed
6+ from pyeudiw .tests .x509 .test_x509 import gen_chain
7+ from ssl import DER_cert_to_PEM_cert
8+
9+ def test_load_anchors ():
10+ db = DBEngine (CONFIG ["storage" ])
11+
12+ pem = DER_cert_to_PEM_cert (gen_chain ()[- 1 ])
13+
14+ anchors = [
15+ {
16+ "entity_id" : "entity" ,
17+ "federation" : {
18+ "entity_configuration" : ta_ec_signed
19+ },
20+ "x509" : {
21+ "pem" : pem
22+ }
23+ }
24+ ]
25+
26+ AnchorsLoader .load_anchors (db , anchors )
27+
28+ entity = db .get_trust_anchor ("entity" )
29+
30+ assert "entity_id" in entity
31+ assert "federation" in entity
32+ assert "entity_configuration" in entity ["federation" ]
33+
34+ assert "x509" in entity
35+ assert "pem" in entity ["x509" ]
You can’t perform that action at this time.
0 commit comments