diff --git a/test/framework/type_checking.py b/test/framework/type_checking.py index 42e22adcd8..ea51ae3a90 100644 --- a/test/framework/type_checking.py +++ b/test/framework/type_checking.py @@ -200,9 +200,6 @@ def test_check_type_of_param_value_checksums(self): [('md5', md5_checksum), ('sha256', sha256_checksum1)], # checksum as dict (file to checksum mapping) [{'foo.txt': sha256_checksum1, 'bar.txt': sha256_checksum2}], - # list of checksums for a single file - [[md5_checksum]], - [[sha256_checksum1, sha256_checksum2, sha256_checksum3]], # in the mix (3 files, each a different kind of checksum spec)... [ sha256_checksum1, @@ -211,20 +208,30 @@ def test_check_type_of_param_value_checksums(self): ], # each item can be a list of checksums for a single file, which can be of different types... [ - # two checksums for a single file, *both* should match - [sha256_checksum1, md5_checksum], - # three checksums for a single file, *all* should match - [sha256_checksum1, ('md5', md5_checksum), {'foo.txt': sha256_checksum1}], + # two alternative checksums for a single file + (sha256_checksum1, md5_checksum), + # three alternative checksums for a single file + (sha256_checksum1, ('md5', md5_checksum), {'foo.txt': sha256_checksum1}), # single checksum for a single file sha256_checksum1, # filename-to-checksum mapping {'foo.txt': sha256_checksum1, 'bar.txt': sha256_checksum2}, - # 3 alternative checksums for a single file, one match is sufficient + # 3 alternative checksums for a single file (sha256_checksum1, sha256_checksum2, sha256_checksum3), - ] + ], + [ + # Normal checksum + sha256_checksum1, + # None is allowed to skip checksum checking + None, + # Also in mappings + {'foo.txt': sha256_checksum1, 'bar.txt': None}, + # alternative checksums are also allowed + {'foo.txt': (sha256_checksum2, sha256_checksum3), 'bar.txt': (sha256_checksum1, md5_checksum)}, + ], ] for inp in inputs: - self.assertEqual(check_type_of_param_value('checksums', inp), (True, inp)) + self.assertTrue(check_type_of_param_value('checksums', inp), 'Failed for ' + str(inp)) def test_check_type_of_param_value_patches(self): """Test check_type_of_param_value function for patches."""