@@ -1196,8 +1196,48 @@ def test_toy_extension_patches(self):
11961196
11971197 self .test_toy_build (ec_file = test_ec )
11981198
1199- def test_toy_extension_sources (self ):
1200- """Test install toy that includes extensions with full sources."""
1199+ def test_toy_extension_sources_single_item_list (self ):
1200+ """Test install toy that includes extensions with 'sources' spec (as single-item list)."""
1201+ test_ecs = os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'easyconfigs' , 'test_ecs' )
1202+ toy_ec = os .path .join (test_ecs , 't' , 'toy' , 'toy-0.0.eb' )
1203+ toy_ec_txt = read_file (toy_ec )
1204+
1205+ test_ec = os .path .join (self .test_prefix , 'test.eb' )
1206+
1207+ # test use of single-element list in 'sources' with just the filename
1208+ test_ec_txt = '\n ' .join ([
1209+ toy_ec_txt ,
1210+ 'exts_list = [' ,
1211+ ' ("bar", "0.0", {' ,
1212+ ' "sources": ["bar-%(version)s.tar.gz"],' ,
1213+ ' }),' ,
1214+ ']' ,
1215+ ])
1216+ write_file (test_ec , test_ec_txt )
1217+ self .test_toy_build (ec_file = test_ec )
1218+
1219+ def test_toy_extension_sources_str (self ):
1220+ """Test install toy that includes extensions with 'sources' spec (as string value)."""
1221+ test_ecs = os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'easyconfigs' , 'test_ecs' )
1222+ toy_ec = os .path .join (test_ecs , 't' , 'toy' , 'toy-0.0.eb' )
1223+ toy_ec_txt = read_file (toy_ec )
1224+
1225+ test_ec = os .path .join (self .test_prefix , 'test.eb' )
1226+
1227+ # test use of single-element list in 'sources' with just the filename
1228+ test_ec_txt = '\n ' .join ([
1229+ toy_ec_txt ,
1230+ 'exts_list = [' ,
1231+ ' ("bar", "0.0", {' ,
1232+ ' "sources": "bar-%(version)s.tar.gz",' ,
1233+ ' }),' ,
1234+ ']' ,
1235+ ])
1236+ write_file (test_ec , test_ec_txt )
1237+ self .test_toy_build (ec_file = test_ec )
1238+
1239+ def test_toy_extension_sources_git_config (self ):
1240+ """Test install toy that includes extensions with 'sources' spec including 'git_config'."""
12011241 test_ecs = os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'easyconfigs' , 'test_ecs' )
12021242 toy_ec = os .path .join (test_ecs , 't' , 'toy' , 'toy-0.0.eb' )
12031243 toy_ec_txt = read_file (toy_ec )
@@ -1230,7 +1270,6 @@ def test_toy_extension_sources(self):
12301270 ']' ,
12311271 ])
12321272 write_file (test_ec , test_ec_txt )
1233-
12341273 self .test_toy_build (ec_file = test_ec )
12351274
12361275 def test_toy_module_fulltxt (self ):
0 commit comments