#NEWLINE# def test_discover_attached_volume( self ) : #NEWLINE# #INDENT# "\n        Datasets that are mounted at a path that matches the container's\n        volume are added to ``Application`` with same name as an\n        ``AttachedVolume``.\n        " #NEWLINE# DATASET_ID = unicode ( uuid4 ( ) ) #NEWLINE# DATASET_ID2 = unicode ( uuid4 ( ) ) #NEWLINE# path1 = FilePath ( b'/flocker' ) . child ( DATASET_ID . encode ( 'ascii' ) ) #NEWLINE# path2 = FilePath ( b'/flocker' ) . child ( DATASET_ID2 . encode ( 'ascii' ) ) #NEWLINE# manifestations = { dataset_id : Manifestation ( dataset = Dataset ( dataset_id = dataset_id ) , primary = True ) for dataset_id in ( DATASET_ID , DATASET_ID2 ) } #NEWLINE# current_known_state = NodeState ( uuid = self . node_uuid , hostname = 'example.com' , manifestations = manifestations , devices = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , paths = { #NEWLINE# #INDENT# DATASET_ID : path1 , #NEWLINE# DATASET_ID2 : path2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# unit1 = UNIT_FOR_APP . set ( 'volumes' , [ DockerVolume ( node_path = path1 , container_path = FilePath ( b'/var/lib/data' ) ) ] ) #NEWLINE# unit2 = UNIT_FOR_APP2 . set ( 'volumes' , [ DockerVolume ( node_path = path2 , container_path = FilePath ( b'/var/lib/data' ) ) ] ) #NEWLINE# units = { #NEWLINE# #INDENT# unit1 . name : unit1 , #NEWLINE# unit2 . name : unit2 , #NEWLINE# #UNINDENT# } #NEWLINE# applications = [ app . set ( 'volume' , AttachedVolume ( manifestation = manifestations [ respective_id ] , mountpoint = FilePath ( b'/var/lib/data' ) ) ) for ( app , respective_id ) in [ ( APP , DATASET_ID ) , ( APP2 , DATASET_ID2 ) ] ] #NEWLINE# self . _verify_discover_state_applications ( units , applications , current_state = current_known_state )