#NEWLINE# def test_run_command_good( self ) : #NEWLINE# #INDENT# 'Test the run command for each container workflow' #NEWLINE# url = '/v1/apps' #NEWLINE# response = self . client . post ( url , HTTP_AUTHORIZATION = 'token {}' . format ( self . token ) ) #NEWLINE# self . assertEqual ( response . status_code , 201 ) #NEWLINE# app_id = response . data [ 'id' ] #NEWLINE# app = App . objects . get ( id = app_id ) #NEWLINE# user = User . objects . get ( username = 'autotest' ) #NEWLINE# build = Build . objects . create ( owner = user , app = app , image = 'qwerty' , procfile = { #NEWLINE# #INDENT# 'web' : 'node server.js' , #NEWLINE# 'worker' : 'node worker.js' , #NEWLINE# #UNINDENT# } , dockerfile = 'foo' , sha = 'somereallylongsha' ) #NEWLINE# release = Release . objects . create ( version = 2 , owner = user , app = app , config = app . config_set . latest ( ) , build = app_id ) #NEWLINE# c = Container . objects . create ( owner = user , app = app , release = release , type = 'web' , num = 1 ) #NEWLINE# ( rc , output ) = c . run ( 'echo hi' ) #NEWLINE# self . assertEqual ( rc , 0 ) #NEWLINE# self . assertEqual ( json . loads ( output ) [ 'entrypoint' ] , '/bin/bash' ) #NEWLINE# build . dockerfile = None #NEWLINE# build . sha = None #NEWLINE# ( rc , output ) = c . run ( 'echo hi' ) #NEWLINE# self . assertEqual ( json . loads ( output ) [ 'entrypoint' ] , '/bin/bash' ) #NEWLINE# build . sha = 'somereallylongsha' #NEWLINE# ( rc , output ) = c . run ( 'echo hi' ) #NEWLINE# self . assertEqual ( json . loads ( output ) [ 'entrypoint' ] , '/runner/init' )