Skip to content

Commit

Permalink
Update test_delegate_hashed_bins()
Browse files Browse the repository at this point in the history
Test is updated to include checks for incorrect target paths.

Signed-off-by: Teodora Sechkova <[email protected]>
  • Loading branch information
sechkova committed Apr 7, 2020
1 parent 0dc7310 commit 1bfa00b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/test_repository_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,13 +1456,19 @@ 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
incorrect_target = os.sep + 'file1.txt'
self.assertRaises(tuf.exceptions.InvalidNameError,
self.targets_object.delegate_hashed_bins,
invalid_targets, public_keys, number_of_bins=16)
"""
[incorrect_target], 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.
Expand Down

0 comments on commit 1bfa00b

Please sign in to comment.