@@ -444,11 +444,14 @@ def test_command_good(self):
444444 app_id = response .data ['id' ]
445445 app = App .objects .get (id = app_id )
446446 user = User .objects .get (username = 'autotest' )
447+ # Heroku Buildpack app
447448 build = Build .objects .create (owner = user ,
448449 app = app ,
449450 image = "qwerty" ,
450451 procfile = {'web' : 'node server.js' ,
451- 'worker' : 'node worker.js' })
452+ 'worker' : 'node worker.js' },
453+ sha = 'african-swallow' ,
454+ dockerfile = '' )
452455 # create an initial release
453456 release = Release .objects .create (version = 2 ,
454457 owner = user ,
@@ -461,10 +464,22 @@ def test_command_good(self):
461464 release = release ,
462465 type = 'web' ,
463466 num = 1 )
467+ # use `start web` for backwards compatibility with slugrunner
468+ self .assertEqual (c ._command , 'start web' )
469+ c .type = 'worker'
470+ self .assertEqual (c ._command , 'start worker' )
471+ # switch to docker image app
472+ build .sha = None
473+ c .type = 'web'
474+ self .assertEqual (c ._command , "bash -c 'node server.js'" )
475+ # switch to dockerfile app
476+ build .sha = 'european-swallow'
477+ build .dockerfile = 'dockerdockerdocker'
464478 self .assertEqual (c ._command , "bash -c 'node server.js'" )
465479 c .type = 'worker'
466480 self .assertEqual (c ._command , "bash -c 'node worker.js'" )
467481 c .release .build .procfile = None
482+ # for backwards compatibility if no Procfile is supplied
468483 self .assertEqual (c ._command , 'start worker' )
469484 c .type = 'cmd'
470485 self .assertEqual (c ._command , '' )
0 commit comments