Skip to content

Commit a98bdc0

Browse files
committed
Remove filename argument from Targets.update()
After the addition of "path" argument in the TargetFile class the filename argument in Targets.update() became redundant. Signed-off-by: Martin Vrachev <[email protected]>
1 parent b2bc6fa commit a98bdc0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/test_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def test_metadata_targets(self):
546546
targets.signed.targets[filename].to_dict(), fileinfo.to_dict()
547547
)
548548
# Update an already existing fileinfo
549-
targets.signed.update(filename, fileinfo)
549+
targets.signed.update(fileinfo)
550550
# Verify that data is updated
551551
self.assertEqual(
552552
targets.signed.targets[filename].to_dict(), fileinfo.to_dict()

tuf/api/metadata.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,6 @@ def to_dict(self) -> Dict[str, Any]:
12541254
return targets_dict
12551255

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

0 commit comments

Comments
 (0)