'When a DATA frame is received at the same time as RST_STREAM,
Twisted does not send WINDOW_UPDATE frames for the stream.'

def test_dataAndRstStream(self):

    frameFactory = FrameFactory()
    transport = StringTransport()
    a = H2Connection()
    a.requestFactory = DummyHTTPHandlerProxy
    frameData = ([('\x00' * (2 ** 14))] * 4)
    bodyLength = '{}'.format(sum((len(data) for data in frameData)))
    headers = (self.postRequestHeaders[:(-1)] + [('content-length', bodyLength)])
    frames = buildRequestFrames(headers=headers, data=frameData, frameFactory=frameFactory)
    del frames[(-1)]
    frames.append(frameFactory.buildRstStreamFrame(streamID=1, errorCode=h2.errors.ErrorCodes.INTERNAL_ERROR))
    requestBytes = frameFactory.clientConnectionPreface()
    requestBytes += ''.join((f.serialize() for f in frames))
    a.makeConnection(transport)
    a.dataReceived(requestBytes)
    frames = framesFromBytes(transport.value())
    windowUpdateFrameIDs = [f.stream_id for f in frames if isinstance(f, hyperframe.frame.WindowUpdateFrame)]
    self.assertEqual([0], windowUpdateFrameIDs)
    headersFrames = [f for f in frames if isinstance(f, hyperframe.frame.HeadersFrame)]
    dataFrames = [f for f in frames if isinstance(f, hyperframe.frame.DataFrame)]
    self.assertFalse(headersFrames)
    self.assertFalse(dataFrames)
