@@ -2560,20 +2560,46 @@ def test_template_constant_dict(self):
25602560 expected ['parallel' ] = 42
25612561 self .assertEqual (res , expected )
25622562
2563- ec = EasyConfig (os .path .join (test_ecs_dir , 't' , 'toy' , 'toy-0.0-deps.eb' ))
2563+ toy_ec = os .path .join (test_ecs_dir , 't' , 'toy' , 'toy-0.0-deps.eb' )
2564+ toy_ec_txt = read_file (toy_ec )
2565+
25642566 # fiddle with version to check version_minor template ('0' should be retained)
2565- ec ['version' ] = '0.01'
2567+ toy_ec_txt = re .sub ('version = .*' , 'version = "0.01"' , toy_ec_txt )
2568+
2569+ my_arch = st .get_cpu_architecture ()
2570+
2571+ # add Java dep with version specified using a dict value
2572+ toy_ec_txt += '\n ' .join ([
2573+ "dependencies += [" ,
2574+ " ('Python', '3.7.2'),"
2575+ " ('Java', {" ,
2576+ " 'arch=%s': '1.8.0_221'," % my_arch ,
2577+ " 'arch=fooarch': '1.8.0-foo'," ,
2578+ " })" ,
2579+ "]" ,
2580+ ])
2581+
2582+ test_ec = os .path .join (self .test_prefix , 'test.eb' )
2583+ write_file (test_ec , toy_ec_txt )
2584+
2585+ ec = EasyConfig (test_ec )
25662586
25672587 expected = {
25682588 'bitbucket_account' : 'toy' ,
25692589 'github_account' : 'toy' ,
2590+ 'javamajver' : '1' ,
2591+ 'javashortver' : '1.8' ,
2592+ 'javaver' : '1.8.0_221' ,
25702593 'name' : 'toy' ,
25712594 'namelower' : 'toy' ,
25722595 'nameletter' : 't' ,
25732596 'toolchain_name' : 'system' ,
25742597 'toolchain_version' : 'system' ,
25752598 'nameletterlower' : 't' ,
25762599 'parallel' : None ,
2600+ 'pymajver' : '3' ,
2601+ 'pyshortver' : '3.7' ,
2602+ 'pyver' : '3.7.2' ,
25772603 'version' : '0.01' ,
25782604 'version_major' : '0' ,
25792605 'version_major_minor' : '0.01' ,
0 commit comments