#NEWLINE# def testGetExternalConfigurationAsFile( self ) : #NEWLINE# #INDENT# 'Test _GetExternalConfiguration() when as_file=True.' #NEWLINE# mock_open = self . mox . CreateMockAnything ( ) #NEWLINE# mock_fh = self . mox . CreateMockAnything ( ) #NEWLINE# mock_isdir = self . mox . CreateMockAnything ( ) #NEWLINE# mock_join = self . mox . CreateMockAnything ( ) #NEWLINE# mock_isdir ( self . settings . _path ) . AndReturn ( True ) #NEWLINE# mock_join ( self . settings . _path , 'name' ) . AndReturn ( '/path/name' ) #NEWLINE# mock_open ( '/path/name' , 'r' ) . AndReturn ( mock_fh ) #NEWLINE# mock_fh . read ( ) . AndReturn ( 'value\n' ) #NEWLINE# mock_fh . close ( ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# self . assertEqual ( 'value' , self . settings . _GetExternalConfiguration ( 'name' , as_file = True , open_ = mock_open , isdir_ = mock_isdir , join_ = mock_join ) ) #NEWLINE# self . mox . VerifyAll ( )