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 26, 2021
1 parent 91b0c59 commit 9229a40
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 @@ -1254,6 +1254,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 9229a40

Please sign in to comment.