#NEWLINE# def test_project_up_with_no_recreate_stopped( self ) : #NEWLINE# #INDENT# web = self . create_service ( 'web' ) #NEWLINE# db = self . create_service ( 'db' , volumes = [ VolumeSpec . parse ( '/var/db' ) ] ) #NEWLINE# project = Project ( 'composetest' , [ web , db ] , self . client ) #NEWLINE# project . start ( ) #NEWLINE# self . assertEqual ( len ( project . containers ( ) ) , 0 ) #NEWLINE# project . up ( [ 'db' ] ) #NEWLINE# project . kill ( ) #NEWLINE# old_containers = project . containers ( stopped = True ) #NEWLINE# self . assertEqual ( len ( old_containers ) , 1 ) #NEWLINE# ( old_container , ) = old_containers #NEWLINE# old_db_id = old_container . id #NEWLINE# db_volume_path = old_container . get_mount ( '/var/db' ) [ 'Source' ] #NEWLINE# project . up ( strategy = ConvergenceStrategy . never ) #NEWLINE# new_containers = project . containers ( stopped = True ) #NEWLINE# self . assertEqual ( len ( new_containers ) , 2 ) #NEWLINE# self . assertEqual ( [ c . is_running for c in new_containers ] , [ True , True ] ) #NEWLINE# db_container = [ c for c in new_containers if ( 'db' in c . name ) ] [ 0 ] #NEWLINE# self . assertEqual ( db_container . id , db ) #NEWLINE# self . assertEqual ( db_container . get_mount ( '/var/db' ) [ 'Source' ] , db_volume_path )