mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Verify non-None role name supplied to tuf.sig.get_signature_status()
This commit is contained in:
parent
5c7333b062
commit
e072cd9961
3 changed files with 3 additions and 4 deletions
|
|
@ -57,7 +57,6 @@ def tearDown(self):
|
|||
|
||||
def test_create_roledb(self):
|
||||
# Verify that a roledb is created for a named repository.
|
||||
print('roledb: ' + repr(tuf.roledb._roledb_dict))
|
||||
self.assertEqual(1, len(tuf.roledb._roledb_dict))
|
||||
self.assertTrue('default' in tuf.roledb._roledb_dict)
|
||||
|
||||
|
|
|
|||
|
|
@ -1075,8 +1075,6 @@ def test_6_download_target(self):
|
|||
# 'download_targetfileinfo' object being tested.
|
||||
if 'custom' in target_fileinfo['fileinfo']:
|
||||
download_targetfileinfo['custom'] = target_fileinfo['fileinfo']['custom']
|
||||
print('target_fileinfo: ' + repr(target_fileinfo['fileinfo']))
|
||||
print('\ndownload_targetfileinfo: ' + repr(download_targetfileinfo))
|
||||
|
||||
self.assertEqual(target_fileinfo['fileinfo'], download_targetfileinfo)
|
||||
|
||||
|
|
|
|||
|
|
@ -97,9 +97,11 @@ def get_signature_status(signable, role=None, repository_name='default'):
|
|||
# all dict keys are properly named. Raise 'tuf.FormatError' if the check
|
||||
# fails.
|
||||
tuf.formats.SIGNABLE_SCHEMA.check_match(signable)
|
||||
tuf.formats.ROLENAME_SCHEMA.check_match(role)
|
||||
tuf.formats.NAME_SCHEMA.check_match(repository_name)
|
||||
|
||||
if role is not None:
|
||||
tuf.formats.ROLENAME_SCHEMA.check_match(role)
|
||||
|
||||
# The signature status dictionary returned.
|
||||
signature_status = {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue