Skip to content

Commit

Permalink
Remove filename argument from Targets.update()
Browse files Browse the repository at this point in the history
After the addition of "path" argument in the TargetFile class the
filename argument in Targets.update() became redundant.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
  • Loading branch information
MVrachev committed Aug 18, 2021
1 parent da864ea commit 440040c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_api.py
Expand Up @@ -546,7 +546,7 @@ def test_metadata_targets(self):
targets.signed.targets[filename].to_dict(), fileinfo.to_dict()
)
# Update an already existing fileinfo
targets.signed.update(filename, fileinfo)
targets.signed.update(fileinfo)
# Verify that data is updated
self.assertEqual(
targets.signed.targets[filename].to_dict(), fileinfo.to_dict()
Expand Down
4 changes: 2 additions & 2 deletions tuf/api/metadata.py
Expand Up @@ -1253,6 +1253,6 @@ def to_dict(self) -> Dict[str, Any]:
return targets_dict

# Modification.
def update(self, filename: str, fileinfo: TargetFile) -> None:
def update(self, fileinfo: TargetFile) -> None:
"""Assigns passed target file info to meta dict."""
self.targets[filename] = fileinfo
self.targets[fileinfo.path] = fileinfo

0 comments on commit 440040c

Please sign in to comment.