@@ -1748,7 +1748,7 @@ def test_dump_template(self):
17481748 "easyblock = 'EB_foo'" ,
17491749 '' ,
17501750 "name = 'Foo'" ,
1751- "version = '0 .0.1 '" ,
1751+ "version = '1 .0.0 '" ,
17521752 "versionsuffix = '-test'" ,
17531753 '' ,
17541754 "homepage = 'http://foo.com/'" ,
@@ -1760,22 +1760,31 @@ def test_dump_template(self):
17601760 '}' ,
17611761 '' ,
17621762 "sources = [" ,
1763- " 'foo-0 .0.1 .tar.gz'," ,
1763+ " 'foo-1 .0.0 .tar.gz'," ,
17641764 ']' ,
17651765 '' ,
17661766 "dependencies = [" ,
17671767 " ('bar', '1.2.3', '-test')," ,
17681768 ']' ,
17691769 '' ,
17701770 "preconfigopts = '--opt1=%s' % name" ,
1771- "configopts = '--opt2=0 .0.1 '" ,
1771+ "configopts = '--opt2=1 .0.0 '" ,
17721772 '' ,
1773+ 'exts_default_options = {' ,
1774+ " 'source_urls': ['https://example.com/files/1.0.0'],"
1775+ '}' ,
1776+ 'exts_list = [' ,
1777+ ' ("ext1", "1.0.0"),'
1778+ ' ("ext2", "2.1.3"),'
1779+ ']' ,
17731780 "sanity_check_paths = {" ,
17741781 " 'files': ['files/foo/foobar', 'files/x-test']," ,
17751782 " 'dirs':[]," ,
17761783 '}' ,
17771784 '' ,
1778- "foo_extra1 = 'foobar'"
1785+ "foo_extra1 = 'foobar'" ,
1786+ '' ,
1787+ 'moduleclass = "tools"' ,
17791788 ])
17801789
17811790 handle , testec = tempfile .mkstemp (prefix = self .test_prefix , suffix = '.eb' )
@@ -1790,7 +1799,7 @@ def test_dump_template(self):
17901799 patterns = [
17911800 r"easyblock = 'EB_foo'" ,
17921801 r"name = 'Foo'" ,
1793- r"version = '0 .0.1 '" ,
1802+ r"version = '1 .0.0 '" ,
17941803 r"versionsuffix = '-test'" ,
17951804 r"homepage = 'http://foo.com/'" ,
17961805 r'description = "foo description"' , # no templating for description
@@ -1799,13 +1808,19 @@ def test_dump_template(self):
17991808 # r"dependencies = \[\n \('bar', '1.2.3', '%\(versionsuffix\)s'\),\n\]",
18001809 r"preconfigopts = '--opt1=%\(name\)s'" ,
18011810 r"configopts = '--opt2=%\(version\)s'" ,
1811+ # no %(version)s template used in exts_default_options or exts_list
1812+ # see https://github.com/easybuilders/easybuild-framework/issues/3091
1813+ r"exts_default_options = {'source_urls': \['https://example.com/files/1\.0\.0'\]}" ,
1814+ r"\('ext1', '1\.0\.0'\)," ,
18021815 r"sanity_check_paths = {\n 'files': \['files/%\(namelower\)s/foobar', 'files/x-test'\]" ,
18031816 ]
18041817
18051818 for pattern in patterns :
18061819 regex = re .compile (pattern , re .M )
18071820 self .assertTrue (regex .search (ectxt ), "Pattern '%s' found in: %s" % (regex .pattern , ectxt ))
18081821
1822+ ectxt .endswith ('moduleclass = "tools"' )
1823+
18091824 # reparsing the dumped easyconfig file should work
18101825 EasyConfig (testec )
18111826
0 commit comments