mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Merge branch 'fix_try_except_else_in_tests' into develop
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
This commit is contained in:
commit
7a3b04cb89
1 changed files with 18 additions and 0 deletions
|
|
@ -721,6 +721,10 @@ def test_3__update_metadata(self):
|
|||
for mirror_error in six.itervalues(e.mirror_errors):
|
||||
assert isinstance(mirror_error, securesystemslib.exceptions.BadVersionNumberError)
|
||||
|
||||
else:
|
||||
self.fail(
|
||||
'Expected a NoWorkingMirrorError composed of BadVersionNumberErrors')
|
||||
|
||||
# Verify that the specific exception raised is correct for the previous
|
||||
# case. The version number is checked, so the specific error in
|
||||
# this case should be 'securesystemslib.exceptions.BadVersionNumberError'.
|
||||
|
|
@ -733,6 +737,10 @@ def test_3__update_metadata(self):
|
|||
for mirror_error in six.itervalues(e.mirror_errors):
|
||||
assert isinstance(mirror_error, securesystemslib.exceptions.BadVersionNumberError)
|
||||
|
||||
else:
|
||||
self.fail(
|
||||
'Expected a NoWorkingMirrorError composed of BadVersionNumberErrors')
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1274,6 +1282,10 @@ def test_6_download_target(self):
|
|||
except OSError as e:
|
||||
self.assertTrue(e.errno == errno.ENAMETOOLONG or e.errno == errno.ENOENT)
|
||||
|
||||
else:
|
||||
self.fail('Expected an OSError of type ENAMETOOLONG or ENOENT')
|
||||
|
||||
|
||||
# Test: Invalid arguments.
|
||||
self.assertRaises(securesystemslib.exceptions.FormatError,
|
||||
self.repository_updater.download_target,
|
||||
|
|
@ -1303,6 +1315,12 @@ def test_6_download_target(self):
|
|||
# which does not generate specific exception errors.
|
||||
self.assertEqual(len(exception.mirror_errors), 0)
|
||||
|
||||
else:
|
||||
self.fail(
|
||||
'Expected a NoWorkingMirrorError with zero mirror errors in it.')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_7_updated_targets(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue