'L{app.AppLogger.stop} removes the observer created in C{start}, and
reinitialize its C{_observer} so that if C{stop} is called several
times it doesn\'t break.'

def test_stop(self):

    removed = []
    observer = object()
    def remove(observer):
        removed.append(observer)
    self.patch(globalLogPublisher, 'removeObserver', remove)
    logger = app.AppLogger({})
    logger._observer = observer
    logger.stop()
    self.assertEqual(removed, [observer])
    logger.stop()
    self.assertEqual(removed, [observer])
    self.assertIsNone(logger._observer)
