@@ -183,7 +183,7 @@ def test_to_from_bytes(self):
183
183
184
184
def test_sign_verify (self ):
185
185
root_path = os .path .join (self .repo_dir , 'metadata' , 'root.json' )
186
- root : Root = Metadata .from_file (root_path ).signed
186
+ root = Metadata [ Root ] .from_file (root_path ).signed
187
187
188
188
# Locate the public keys we need from root
189
189
targets_keyid = next (iter (root .roles ["targets" ].keyids ))
@@ -302,7 +302,7 @@ def test_metadata_base(self):
302
302
def test_metadata_snapshot (self ):
303
303
snapshot_path = os .path .join (
304
304
self .repo_dir , 'metadata' , 'snapshot.json' )
305
- snapshot = Metadata .from_file (snapshot_path )
305
+ snapshot = Metadata [ Snapshot ] .from_file (snapshot_path )
306
306
307
307
# Create a MetaFile instance representing what we expect
308
308
# the updated data to be.
@@ -321,7 +321,7 @@ def test_metadata_snapshot(self):
321
321
def test_metadata_timestamp (self ):
322
322
timestamp_path = os .path .join (
323
323
self .repo_dir , 'metadata' , 'timestamp.json' )
324
- timestamp = Metadata .from_file (timestamp_path )
324
+ timestamp = Metadata [ Timestamp ] .from_file (timestamp_path )
325
325
326
326
self .assertEqual (timestamp .signed .version , 1 )
327
327
timestamp .signed .bump_version ()
@@ -358,19 +358,19 @@ def test_metadata_timestamp(self):
358
358
359
359
def test_metadata_verify_delegate (self ):
360
360
root_path = os .path .join (self .repo_dir , 'metadata' , 'root.json' )
361
- root = Metadata .from_file (root_path )
361
+ root = Metadata [ Root ] .from_file (root_path )
362
362
snapshot_path = os .path .join (
363
363
self .repo_dir , 'metadata' , 'snapshot.json' )
364
- snapshot = Metadata .from_file (snapshot_path )
364
+ snapshot = Metadata [ Snapshot ] .from_file (snapshot_path )
365
365
targets_path = os .path .join (
366
366
self .repo_dir , 'metadata' , 'targets.json' )
367
- targets = Metadata .from_file (targets_path )
367
+ targets = Metadata [ Targets ] .from_file (targets_path )
368
368
role1_path = os .path .join (
369
369
self .repo_dir , 'metadata' , 'role1.json' )
370
- role1 = Metadata .from_file (role1_path )
370
+ role1 = Metadata [ Targets ] .from_file (role1_path )
371
371
role2_path = os .path .join (
372
372
self .repo_dir , 'metadata' , 'role2.json' )
373
- role2 = Metadata .from_file (role2_path )
373
+ role2 = Metadata [ Targets ] .from_file (role2_path )
374
374
375
375
# test the expected delegation tree
376
376
root .verify_delegate ('root' , root )
@@ -468,7 +468,7 @@ def test_role_class(self):
468
468
def test_metadata_root (self ):
469
469
root_path = os .path .join (
470
470
self .repo_dir , 'metadata' , 'root.json' )
471
- root = Metadata .from_file (root_path )
471
+ root = Metadata [ Root ] .from_file (root_path )
472
472
473
473
# Add a second key to root role
474
474
root_key2 = import_ed25519_publickey_from_file (
@@ -530,7 +530,7 @@ def test_delegation_class(self):
530
530
def test_metadata_targets (self ):
531
531
targets_path = os .path .join (
532
532
self .repo_dir , 'metadata' , 'targets.json' )
533
- targets = Metadata .from_file (targets_path )
533
+ targets = Metadata [ Targets ] .from_file (targets_path )
534
534
535
535
# Create a fileinfo dict representing what we expect the updated data to be
536
536
filename = 'file2.txt'
@@ -560,7 +560,7 @@ def test_length_and_hash_validation(self):
560
560
# for untrusted metadata file to verify.
561
561
timestamp_path = os .path .join (
562
562
self .repo_dir , 'metadata' , 'timestamp.json' )
563
- timestamp = Metadata .from_file (timestamp_path )
563
+ timestamp = Metadata [ Timestamp ] .from_file (timestamp_path )
564
564
snapshot_metafile = timestamp .signed .meta ["snapshot.json" ]
565
565
566
566
snapshot_path = os .path .join (
@@ -603,7 +603,7 @@ def test_length_and_hash_validation(self):
603
603
# Test target files' hash and length verification
604
604
targets_path = os .path .join (
605
605
self .repo_dir , 'metadata' , 'targets.json' )
606
- targets = Metadata .from_file (targets_path )
606
+ targets = Metadata [ Targets ] .from_file (targets_path )
607
607
file1_targetfile = targets .signed .targets ['file1.txt' ]
608
608
filepath = os .path .join (
609
609
self .repo_dir , 'targets' , 'file1.txt' )
0 commit comments