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:
Teodora Sechkova 2020-04-07 03:39:47 -07:00
parent 77f5f730f3
commit 57b40518c8
No known key found for this signature in database
GPG key ID: 65F78F613EA1914E

View file

@ -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.