def test_requestShellWithData(self):
        """
        When a client executes a shell, it should be able to give pass data
        back and forth between the local and the remote side.
        """
        ret = self.session.requestReceived(b'shell', b'')
        self.assertTrue(ret)
        self.assertSessionIsStubSession()
        self.session.dataReceived(b'some data\x00')
        self.assertEqual(self.session.session.shellTransport.data,
                          b'some data\x00')
        self.assertEqual(self.session.conn.data[self.session],
                          [b'some data\x00', b'\r\n'])
        self.assertTrue(self.session.session.shellTransport.closed)
        self.assertEqual(self.session.conn.requests[self.session],
                          [(b'exit-status', b'\x00\x00\x00\x00', False)])

        When a client executes a shell, it should be able to give pass data
        back and forth between the local and the remote side.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_session.py