#NEWLINE# @ mock . patch . object ( console_utils , '_get_console_pid_dir' , autospec = True ) #NEWLINE# def test__get_console_pid_file( self , mock_dir ) : #NEWLINE# #INDENT# mock_dir . return_value = tempfile . gettempdir ( ) #NEWLINE# expected_path = ( '%(tempdir)s/%(uuid)s.pid' % { #NEWLINE# #INDENT# 'tempdir' : mock_dir . return_value , #NEWLINE# 'uuid' : self . info . get ( 'uuid' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# path = console_utils . _get_console_pid_file ( self . info [ 'uuid' ] ) #NEWLINE# self . assertEqual ( expected_path , self ) #NEWLINE# mock_dir . assert_called_once_with ( )