mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Update test_delegate_hashed_bins()
Test is updated to include checks for incorrect target paths. Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
This commit is contained in:
parent
77f5f730f3
commit
57b40518c8
1 changed files with 11 additions and 6 deletions
|
|
@ -1452,13 +1452,18 @@ def check_prefixes_match_range():
|
|||
list_of_targets, public_keys, number_of_bins=3)
|
||||
|
||||
# Invalid 'list_of_targets'.
|
||||
# TODO
|
||||
"""
|
||||
invalid_targets = ['/non-existent']
|
||||
self.assertRaises(securesystemslib.exceptions.Error,
|
||||
# A path or target starting with a directory separator
|
||||
self.assertRaises(tuf.exceptions.InvalidNameError,
|
||||
self.targets_object.delegate_hashed_bins,
|
||||
invalid_targets, public_keys, number_of_bins=16)
|
||||
"""
|
||||
['/file1.txt'], public_keys,
|
||||
number_of_bins=2)
|
||||
|
||||
# A path or target using '\' as a directory separator
|
||||
self.assertRaises(tuf.exceptions.InvalidNameError,
|
||||
self.targets_object.delegate_hashed_bins,
|
||||
['subpath\\file1.txt'], public_keys,
|
||||
number_of_bins=2)
|
||||
|
||||
|
||||
def test_add_target_to_bin(self):
|
||||
# Test normal case.
|
||||
|
|
|
|||
Loading…
Reference in a new issue