#NEWLINE# def testGetExternalConfiguration( self ) : #NEWLINE# #INDENT# 'Test _GetExternalConfiguration() when as_file=False.' #NEWLINE# mock_open = self . mox . CreateMockAnything ( ) #NEWLINE# mock_fh = self . mox . CreateMockAnything ( ) #NEWLINE# mock_cp = self . mox . CreateMockAnything ( ) #NEWLINE# mock_isdir = self . mox . CreateMockAnything ( ) #NEWLINE# mock_join = self . mox . CreateMockAnything ( ) #NEWLINE# self . mox . StubOutWithMock ( settings . ConfigParser , 'ConfigParser' , True ) #NEWLINE# self . mox . StubOutWithMock ( self . settings , '_TranslateValue' ) #NEWLINE# mock_isdir ( self . settings . _path ) . AndReturn ( True ) #NEWLINE# mock_join ( self . settings . _path , 'name' ) . AndReturn ( '/path/name' ) #NEWLINE# mock_open ( '/path/name.cfg' , 'r' ) . AndReturn ( mock_fh ) #NEWLINE# settings . ConfigParser . ConfigParser ( ) . AndReturn ( self ) #NEWLINE# mock_cp . readfp ( mock_fh ) #NEWLINE# mock_fh . close ( ) #NEWLINE# mock_cp . items ( 'settings' ) . AndReturn ( ( ( 'name2' , 'value2' ) , ( 'name' , 'value' ) ) ) #NEWLINE# self . settings . _TranslateValue ( 'value2' ) . AndReturn ( 'value2' ) #NEWLINE# self . settings . _TranslateValue ( 'value' ) . AndReturn ( 'value' ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'name2' : 'value2' , #NEWLINE# 'name' : 'value' , #NEWLINE# #UNINDENT# } , self . settings . _GetExternalConfiguration ( 'name' , as_file = False , open_ = mock_open , isdir_ = mock_isdir , join_ = mock_join ) ) #NEWLINE# self . mox . VerifyAll ( )