#NEWLINE# def test_stop( self ) : #NEWLINE# #INDENT# "\n        L{app.AppLogger.stop} removes the observer created in C{start}, and\n        reinitialize its C{_observer} so that if C{stop} is called several\n        times it doesn't break.\n        " #NEWLINE# removed = [ ] #NEWLINE# observer = object ( ) #NEWLINE# def remove( observer ) : #NEWLINE# #INDENT# removed . append ( observer ) #NEWLINE# #UNINDENT# self . patch ( globalLogPublisher , 'removeObserver' , removed ) #NEWLINE# logger = app . AppLogger ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# logger . _observer = observer #NEWLINE# logger . stop ( ) #NEWLINE# self . assertEqual ( removed , [ observer ] ) #NEWLINE# logger . stop ( ) #NEWLINE# self . assertEqual ( removed , [ observer ] ) #NEWLINE# self . assertIdentical ( logger . _observer , None )