@@ -5948,6 +5948,42 @@ def test_inject_checksums(self):
59485948 ]
59495949 self .assertEqual (ec ['checksums' ], expected_checksums )
59505950
5951+ # Also works for extensions (all 3 patch formats)
5952+ write_file (test_ec , textwrap .dedent ("""
5953+ exts_list = [
5954+ ("bar", "0.0", {
5955+ 'sources': ['bar-0.0-local.tar.gz'],
5956+ 'patches': [
5957+ 'bar-0.0_fix-silly-typo-in-printf-statement.patch', # normal patch
5958+ ('bar-0.0_fix-very-silly-typo-in-printf-statement.patch', 0), # patch with patch level
5959+ ('toy-0.0_fix-silly-typo-in-printf-statement.patch', 'toy_subdir'),
5960+ ],
5961+ }),
5962+ ]
5963+ """ ), append = True )
5964+ self ._run_mock_eb (args , raise_error = True , strip = True )
5965+ ec = EasyConfigParser (test_ec ).get_config_dict ()
5966+ ext = ec ['exts_list' ][0 ]
5967+ self .assertEqual ((ext [0 ], ext [1 ]), ("bar" , "0.0" ))
5968+ ext_opts = ext [2 ]
5969+ expected_patches = [
5970+ 'bar-0.0_fix-silly-typo-in-printf-statement.patch' ,
5971+ ('bar-0.0_fix-very-silly-typo-in-printf-statement.patch' , 0 ),
5972+ ('toy-0.0_fix-silly-typo-in-printf-statement.patch' , 'toy_subdir' )
5973+ ]
5974+ self .assertEqual (ext_opts ['patches' ], expected_patches )
5975+ expected_checksums = [
5976+ {'bar-0.0-local.tar.gz' :
5977+ 'f3676716b610545a4e8035087f5be0a0248adee0abb3930d3edb76d498ae91e7' },
5978+ {'bar-0.0_fix-silly-typo-in-printf-statement.patch' :
5979+ '84db53592e882b5af077976257f9c7537ed971cb2059003fd4faa05d02cae0ab' },
5980+ {'bar-0.0_fix-very-silly-typo-in-printf-statement.patch' :
5981+ 'd0bf102f9c5878445178c5f49b7cd7546e704c33fe2060c7354b7e473cfeb52b' },
5982+ {'toy-0.0_fix-silly-typo-in-printf-statement.patch' :
5983+ '81a3accc894592152f81814fbf133d39afad52885ab52c25018722c7bda92487' }
5984+ ]
5985+ self .assertEqual (ext_opts ['checksums' ], expected_checksums )
5986+
59515987 # passing easyconfig filename as argument to --inject-checksums results in error being reported,
59525988 # because it's not a valid type of checksum
59535989 args = ['--inject-checksums' , test_ec ]
0 commit comments