def test_switchToBodyMode(self):
        """
        L{HTTPParser.switchToBodyMode} raises L{RuntimeError} if called more
        than once.
        """
        protocol = HTTPParser()
        protocol.makeConnection(StringTransport())
        protocol.switchToBodyMode(object())
        self.assertRaises(RuntimeError, protocol.switchToBodyMode, object())

        L{HTTPParser.switchToBodyMode} raises L{RuntimeError} if called more
        than once.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_newclient.py