def test_remote_flow_control_is_limited_by_connection(self, frame_factory):
        """
        The remote flow control window is limited by the flow control of the
        connection.
        """
        c = h2.connection.H2Connection(client_side=False)
        c.receive_data(frame_factory.preamble())
        f1 = frame_factory.build_headers_frame(self.example_request_headers)
        f2 = frame_factory.build_data_frame(b'some data')
        f3 = frame_factory.build_headers_frame(
            self.example_request_headers,
            stream_id=3,
        )
        c.receive_data(f1.serialize() + f2.serialize() + f3.serialize())

        remaining_length = self.DEFAULT_FLOW_WINDOW - len(b'some data')
        assert (c.remote_flow_control_window(3) == remaining_length)
dataset/ETHPy150Open python-hyper/hyper-h2/test/test_flow_control_window.py/TestFlowControl.test_remote_flow_control_is_limited_by_connection/original