@@ -1520,6 +1520,8 @@ test(
15201520 { skip : ! hasPython ( 3.6 ) }
15211521) ;
15221522
1523+
1524+
15231525test (
15241526 'py3.6 can package flask with package individually & slim option' ,
15251527 async t => {
@@ -1769,6 +1771,40 @@ test(
17691771 { skip : ! hasPython ( 2.7 ) }
17701772) ;
17711773
1774+ test (
1775+ 'py2.7 can ignore functions defined with `image`' ,
1776+ async t => {
1777+ process . chdir ( 'tests/base' ) ;
1778+ const path = npm ( [ 'pack' , '../..' ] ) ;
1779+ npm ( [ 'i' , path ] ) ;
1780+ sls ( [ '--individually=true' , '--runtime=python2.7' , 'package' ] ) ;
1781+
1782+ t . true (
1783+ pathExistsSync ( '.serverless/hello.zip' ) ,
1784+ 'function hello is packaged'
1785+ ) ;
1786+ t . true (
1787+ pathExistsSync ( '.serverless/hello2.zip' ) ,
1788+ 'function hello2 is packaged'
1789+ ) ;
1790+ t . true (
1791+ pathExistsSync ( '.serverless/hello3.zip' ) ,
1792+ 'function hello3 is packaged'
1793+ ) ;
1794+ t . true (
1795+ pathExistsSync ( '.serverless/hello4.zip' ) ,
1796+ 'function hello4 is packaged'
1797+ ) ;
1798+ t . false (
1799+ pathExistsSync ( '.serverless/hello5.zip' ) ,
1800+ 'function hello5 is not packaged'
1801+ ) ;
1802+
1803+ t . end ( ) ;
1804+ } ,
1805+ { skip : ! hasPython ( 2.7 ) }
1806+ ) ;
1807+
17721808test (
17731809 'py3.6 can package only requirements of module' ,
17741810 async t => {
@@ -2234,3 +2270,38 @@ test(
22342270 } ,
22352271 { skip : ! canUseDocker ( ) || ! hasPython ( 3.6 ) || brokenOn ( 'win32' ) }
22362272) ;
2273+
2274+ test (
2275+ 'py3.6 can ignore functions defined with `image`' ,
2276+ async t => {
2277+ process . chdir ( 'tests/base' ) ;
2278+ const path = npm ( [ 'pack' , '../..' ] ) ;
2279+ npm ( [ 'i' , path ] ) ;
2280+ sls ( [ '--individually=true' , 'package' ] ) ;
2281+
2282+
2283+ t . true (
2284+ pathExistsSync ( '.serverless/hello.zip' ) ,
2285+ 'function hello is packaged'
2286+ ) ;
2287+ t . true (
2288+ pathExistsSync ( '.serverless/hello2.zip' ) ,
2289+ 'function hello2 is packaged'
2290+ ) ;
2291+ t . true (
2292+ pathExistsSync ( '.serverless/hello3.zip' ) ,
2293+ 'function hello3 is packaged'
2294+ ) ;
2295+ t . true (
2296+ pathExistsSync ( '.serverless/hello4.zip' ) ,
2297+ 'function hello4 is packaged'
2298+ ) ;
2299+ t . false (
2300+ pathExistsSync ( '.serverless/hello5.zip' ) ,
2301+ 'function hello5 is not packaged'
2302+ ) ;
2303+
2304+ t . end ( ) ;
2305+ } ,
2306+ { skip : ! hasPython ( 3.6 ) }
2307+ ) ;
0 commit comments