@@ -183,7 +183,7 @@ def test_to_from_bytes(self):
183183
184184 def test_sign_verify (self ):
185185 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
187187
188188 # Locate the public keys we need from root
189189 targets_keyid = next (iter (root .roles ["targets" ].keyids ))
@@ -302,7 +302,7 @@ def test_metadata_base(self):
302302 def test_metadata_snapshot (self ):
303303 snapshot_path = os .path .join (
304304 self .repo_dir , 'metadata' , 'snapshot.json' )
305- snapshot = Metadata .from_file (snapshot_path )
305+ snapshot = Metadata [ Snapshot ] .from_file (snapshot_path )
306306
307307 # Create a MetaFile instance representing what we expect
308308 # the updated data to be.
@@ -321,7 +321,7 @@ def test_metadata_snapshot(self):
321321 def test_metadata_timestamp (self ):
322322 timestamp_path = os .path .join (
323323 self .repo_dir , 'metadata' , 'timestamp.json' )
324- timestamp = Metadata .from_file (timestamp_path )
324+ timestamp = Metadata [ Timestamp ] .from_file (timestamp_path )
325325
326326 self .assertEqual (timestamp .signed .version , 1 )
327327 timestamp .signed .bump_version ()
@@ -358,19 +358,19 @@ def test_metadata_timestamp(self):
358358
359359 def test_metadata_verify_delegate (self ):
360360 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 )
362362 snapshot_path = os .path .join (
363363 self .repo_dir , 'metadata' , 'snapshot.json' )
364- snapshot = Metadata .from_file (snapshot_path )
364+ snapshot = Metadata [ Snapshot ] .from_file (snapshot_path )
365365 targets_path = os .path .join (
366366 self .repo_dir , 'metadata' , 'targets.json' )
367- targets = Metadata .from_file (targets_path )
367+ targets = Metadata [ Targets ] .from_file (targets_path )
368368 role1_path = os .path .join (
369369 self .repo_dir , 'metadata' , 'role1.json' )
370- role1 = Metadata .from_file (role1_path )
370+ role1 = Metadata [ Targets ] .from_file (role1_path )
371371 role2_path = os .path .join (
372372 self .repo_dir , 'metadata' , 'role2.json' )
373- role2 = Metadata .from_file (role2_path )
373+ role2 = Metadata [ Targets ] .from_file (role2_path )
374374
375375 # test the expected delegation tree
376376 root .verify_delegate ('root' , root )
@@ -468,7 +468,7 @@ def test_role_class(self):
468468 def test_metadata_root (self ):
469469 root_path = os .path .join (
470470 self .repo_dir , 'metadata' , 'root.json' )
471- root = Metadata .from_file (root_path )
471+ root = Metadata [ Root ] .from_file (root_path )
472472
473473 # Add a second key to root role
474474 root_key2 = import_ed25519_publickey_from_file (
@@ -530,7 +530,7 @@ def test_delegation_class(self):
530530 def test_metadata_targets (self ):
531531 targets_path = os .path .join (
532532 self .repo_dir , 'metadata' , 'targets.json' )
533- targets = Metadata .from_file (targets_path )
533+ targets = Metadata [ Targets ] .from_file (targets_path )
534534
535535 # Create a fileinfo dict representing what we expect the updated data to be
536536 filename = 'file2.txt'
@@ -560,7 +560,7 @@ def test_length_and_hash_validation(self):
560560 # for untrusted metadata file to verify.
561561 timestamp_path = os .path .join (
562562 self .repo_dir , 'metadata' , 'timestamp.json' )
563- timestamp = Metadata .from_file (timestamp_path )
563+ timestamp = Metadata [ Timestamp ] .from_file (timestamp_path )
564564 snapshot_metafile = timestamp .signed .meta ["snapshot.json" ]
565565
566566 snapshot_path = os .path .join (
@@ -603,7 +603,7 @@ def test_length_and_hash_validation(self):
603603 # Test target files' hash and length verification
604604 targets_path = os .path .join (
605605 self .repo_dir , 'metadata' , 'targets.json' )
606- targets = Metadata .from_file (targets_path )
606+ targets = Metadata [ Targets ] .from_file (targets_path )
607607 file1_targetfile = targets .signed .targets ['file1.txt' ]
608608 filepath = os .path .join (
609609 self .repo_dir , 'targets' , 'file1.txt' )
0 commit comments