Skip to content

Commit b9b05dc

Browse files
author
Kairo de Araujo
committed
Remove the vague variable name
Removes the vague variable name ``expected_result`` and adds to the test within the loop (the same level as ``_assert_targets_files_exist``). The test is done directly with the target path called the fetch tracker from Repository Simulator, which is clean after that. Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
1 parent 48ee46f commit b9b05dc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tests/test_updater_consistent_snapshot.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,24 @@ def test_download_targets(self, test_case_data: Dict[str, Any]):
213213
updater.config.prefix_targets_with_hash = prefix_targets_with_hash
214214
updater.refresh()
215215

216-
expected_result = []
217216
for targetpath in targetpaths:
218217
info = updater.get_targetinfo(targetpath)
219218
updater.download_target(info)
220-
expected_prefix = None if not hash_algo else info.hashes[hash_algo]
221-
expected_result.append((targetpath, expected_prefix))
219+
222220
# target files are always persisted without hash prefix
223221
self._assert_targets_files_exist([info.path])
224222

225-
226-
# files are fetched with the expected hash prefix (or None)
227-
self.assertListEqual(sim.fetch_tracker.targets, expected_result)
223+
# files are fetched with the expected hash prefix (or None)
224+
self.assertListEqual(
225+
sim.fetch_tracker.targets,
226+
[
227+
(
228+
targetpath,
229+
None if not hash_algo else info.hashes[hash_algo],
230+
)
231+
],
232+
)
233+
sim.fetch_tracker.targets.clear()
228234

229235
self._cleanup_dir(self.targets_dir)
230236

0 commit comments

Comments
 (0)