def test_selectDefaultLogObserverDefaultWithoutTTY(self):
        """
        L{TwistOptions.selectDefaultLogObserver} will not override an already
        selected observer.
        """
        self.patchOpen()

        options = TwistOptions()
        options.opt_log_file("queso")  # File, not a tty
        options.selectDefaultLogObserver()

        self.assertIdentical(
            options["fileLogObserverFactory"], jsonFileLogObserver
        )
        self.assertEqual(options["logFormat"], "json")

        L{TwistOptions.selectDefaultLogObserver} will not override an already
        selected observer.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/twist/test/test_options.py