#NEWLINE# def testStop( self ) : #NEWLINE# #INDENT# mix = dockermix . ContainerMix ( 'dockermix-startstop.yml' ) #NEWLINE# mix . build ( ) #NEWLINE# env = yaml . load ( mix . dump ( ) ) #NEWLINE# for container in env [ 'containers' ] : #NEWLINE# #INDENT# state = docker . Client ( ) . inspect_container ( env [ 'containers' ] [ container ] [ 'container_id' ] ) #NEWLINE# self . assertTrue ( state [ 'State' ] [ 'Running' ] ) #NEWLINE# self . assertEqual ( state [ 'State' ] [ 'ExitCode' ] , 0 ) #NEWLINE# #UNINDENT# mix . stop ( timeout = 1 ) #NEWLINE# env = yaml . load ( mix . dump ( ) ) #NEWLINE# for container in env [ 'containers' ] : #NEWLINE# #INDENT# state = docker . Client ( ) . inspect_container ( env [ 'containers' ] [ container ] [ 'container_id' ] ) #NEWLINE# self . assertFalse ( state [ 'State' ] [ 'Running' ] ) #NEWLINE# self . assertNotEqual ( state [ 'State' ] [ 'ExitCode' ] , 0 ) #NEWLINE# #UNINDENT# mix . start ( ) #NEWLINE# mix . stop ( 'test_server_2' , timeout = 1 ) #NEWLINE# state = docker . Client ( ) . inspect_container ( env [ 'containers' ] [ 'test_server_2' ] [ 'container_id' ] ) #NEWLINE# self . assertFalse ( state [ 'State' ] [ 'Running' ] ) #NEWLINE# self . assertNotEqual ( state [ 'State' ] [ 'ExitCode' ] , 0 ) #NEWLINE# state = docker . Client ( ) . inspect_container ( env [ 'containers' ] [ 'test_server_1' ] [ 'container_id' ] ) #NEWLINE# self . assertTrue ( state [ 'State' ] [ 'Running' ] ) #NEWLINE# self . assertEqual ( state [ 'State' ] [ 'ExitCode' ] , 0 ) #NEWLINE# mix . destroy ( timeout = 1 )