def test_write(self):
        """
        Writing to a StdioOnnaStick instance results in Twisted log messages.

        Log messages are generated every time a '\\n' is encountered.
        """
        stdio = log.StdioOnnaStick()
        stdio.write("Hello there\nThis is a test")
        self.assertEqual(self.getLogMessages(), ["Hello there"])
        stdio.write("!\n")
        self.assertEqual(self.getLogMessages(),
                         ["Hello there", "This is a test!"])

        Writing to a StdioOnnaStick instance results in Twisted log messages.

        Log messages are generated every time a '\n' is encountered.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_log.py