17
17
from tuf .api .metadata import (
18
18
SPECIFICATION_VERSION ,
19
19
TOP_LEVEL_ROLE_NAMES ,
20
+ TargetFile ,
20
21
Targets ,
21
22
)
22
23
from tuf .ngclient import Updater
@@ -109,7 +110,9 @@ def _assert_targets_files_exist(self, filenames: Iterable[str]) -> None:
109
110
}
110
111
111
112
@utils .run_sub_tests_with_dataset (top_level_roles_data )
112
- def test_top_level_roles_update (self , test_case_data : Dict [str , Any ]):
113
+ def test_top_level_roles_update (
114
+ self , test_case_data : Dict [str , Any ]
115
+ ) -> None :
113
116
# Test if the client fetches and stores metadata files with the
114
117
# correct version prefix, depending on 'consistent_snapshot' config
115
118
consistent_snapshot : bool = test_case_data ["consistent_snapshot" ]
@@ -143,7 +146,9 @@ def test_top_level_roles_update(self, test_case_data: Dict[str, Any]):
143
146
}
144
147
145
148
@utils .run_sub_tests_with_dataset (delegated_roles_data )
146
- def test_delegated_roles_update (self , test_case_data : Dict [str , Any ]):
149
+ def test_delegated_roles_update (
150
+ self , test_case_data : Dict [str , Any ]
151
+ ) -> None :
147
152
# Test if the client fetches and stores delegated metadata files with
148
153
# the correct version prefix, depending on 'consistent_snapshot' config
149
154
consistent_snapshot : bool = test_case_data ["consistent_snapshot" ]
@@ -193,7 +198,7 @@ def test_delegated_roles_update(self, test_case_data: Dict[str, Any]):
193
198
}
194
199
195
200
@utils .run_sub_tests_with_dataset (targets_download_data )
196
- def test_download_targets (self , test_case_data : Dict [str , Any ]):
201
+ def test_download_targets (self , test_case_data : Dict [str , Any ]) -> None :
197
202
# Test if the client fetches and stores target files with
198
203
# the correct hash prefix, depending on 'consistent_snapshot'
199
204
# and 'prefix_targets_with_hash' config
@@ -220,6 +225,7 @@ def test_download_targets(self, test_case_data: Dict[str, Any]):
220
225
221
226
for targetpath in targetpaths :
222
227
info = updater .get_targetinfo (targetpath )
228
+ assert isinstance (info , TargetFile )
223
229
updater .download_target (info )
224
230
expected_prefix = (
225
231
None if not hash_algo else info .hashes [hash_algo ]
0 commit comments