'A protocol error from the remote peer terminates the connection.'

def test_protocolErrorTerminatesConnection(self):

    f = FrameFactory()
    b = StringTransport()
    a = H2Connection()
    a.requestFactory = DummyHTTPHandlerProxy
    requestBytes = f.clientConnectionPreface()
    requestBytes += buildRequestBytes(self.getRequestHeaders, [], f)
    requestBytes += f.buildPushPromiseFrame(streamID=1, promisedStreamID=2, headers=self.getRequestHeaders, flags=['END_HEADERS']).serialize()
    a.makeConnection(b)
    for byte in iterbytes(requestBytes):
        a.dataReceived(byte)
        if b.disconnecting:
            break
    frames = framesFromBytes(b.value())
    self.assertEqual(len(frames), 3)
    self.assertTrue(isinstance(frames[(-1)], hyperframe.frame.GoAwayFrame))
    self.assertTrue(b.disconnecting)
