diff --git a/tests/test_arbitrary_package_attack.py b/tests/test_arbitrary_package_attack.py index e808458c..f37abef4 100755 --- a/tests/test_arbitrary_package_attack.py +++ b/tests/test_arbitrary_package_attack.py @@ -240,9 +240,10 @@ def test_with_tuf(self): # Verify that the expected 'tuf.exceptions.DownloadLengthMismatchError' exception # is raised for 'url_file'. - self.assertTrue(url_file in exception.mirror_errors) - self.assertTrue(isinstance(exception.mirror_errors[url_file], - securesystemslib.exceptions.BadHashError)) + self.assertTrue(url_file.replace('\\', '/') in exception.mirror_errors) + self.assertTrue( + isinstance(exception.mirror_errors[url_file.replace('\\', '/')], + securesystemslib.exceptions.BadHashError)) else: self.fail('TUF did not prevent an arbitrary package attack.') @@ -292,9 +293,10 @@ def test_with_tuf_and_metadata_tampering(self): self.assertTrue(len(exception.mirror_errors), 1) # Verify that the specific and expected mirror exception is raised. - self.assertTrue(url_file in exception.mirror_errors) - self.assertTrue(isinstance(exception.mirror_errors[url_file], - securesystemslib.exceptions.BadHashError)) + self.assertTrue(url_file.replace('\\', '/') in exception.mirror_errors) + self.assertTrue( + isinstance(exception.mirror_errors[url_file.replace('\\', '/')], + securesystemslib.exceptions.BadHashError)) else: self.fail('TUF did not prevent an arbitrary package attack.')