@@ -456,11 +456,14 @@ def test_command_good(self):
456456 app_id = response .data ['id' ]
457457 app = App .objects .get (id = app_id )
458458 user = User .objects .get (username = 'autotest' )
459+ # Heroku Buildpack app
459460 build = Build .objects .create (owner = user ,
460461 app = app ,
461462 image = "qwerty" ,
462463 procfile = {'web' : 'node server.js' ,
463- 'worker' : 'node worker.js' })
464+ 'worker' : 'node worker.js' },
465+ sha = 'african-swallow' ,
466+ dockerfile = '' )
464467 # create an initial release
465468 release = Release .objects .create (version = 2 ,
466469 owner = user ,
@@ -473,10 +476,22 @@ def test_command_good(self):
473476 release = release ,
474477 type = 'web' ,
475478 num = 1 )
479+ # use `start web` for backwards compatibility with slugrunner
480+ self .assertEqual (c ._command , 'start web' )
481+ c .type = 'worker'
482+ self .assertEqual (c ._command , 'start worker' )
483+ # switch to docker image app
484+ build .sha = None
485+ c .type = 'web'
486+ self .assertEqual (c ._command , "bash -c 'node server.js'" )
487+ # switch to dockerfile app
488+ build .sha = 'european-swallow'
489+ build .dockerfile = 'dockerdockerdocker'
476490 self .assertEqual (c ._command , "bash -c 'node server.js'" )
477491 c .type = 'worker'
478492 self .assertEqual (c ._command , "bash -c 'node worker.js'" )
479493 c .release .build .procfile = None
494+ # for backwards compatibility if no Procfile is supplied
480495 self .assertEqual (c ._command , 'start worker' )
481496 c .type = 'cmd'
482497 self .assertEqual (c ._command , '' )
0 commit comments