当前位置: 首页>>代码示例>>Python>>正文


Python DataFrame.flags方法代码示例

本文整理汇总了Python中hyperframe.frame.DataFrame.flags方法的典型用法代码示例。如果您正苦于以下问题:Python DataFrame.flags方法的具体用法?Python DataFrame.flags怎么用?Python DataFrame.flags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hyperframe.frame.DataFrame的用法示例。


在下文中一共展示了DataFrame.flags方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_data_frame_with_padding_calculates_flow_control_len

# 需要导入模块: from hyperframe.frame import DataFrame [as 别名]
# 或者: from hyperframe.frame.DataFrame import flags [as 别名]
    def test_data_frame_with_padding_calculates_flow_control_len(self):
        f = DataFrame(1)
        f.flags = set(['PADDED'])
        f.data = b'testdata'
        f.pad_length = 10

        assert f.flow_controlled_length == 19
开发者ID:vivekanand1101,项目名称:hyperframe,代码行数:9,代码来源:test_hyperframe.py

示例2: test_data_frame_serializes_properly

# 需要导入模块: from hyperframe.frame import DataFrame [as 别名]
# 或者: from hyperframe.frame.DataFrame import flags [as 别名]
    def test_data_frame_serializes_properly(self):
        f = DataFrame(1)
        f.flags = set(['END_STREAM'])
        f.data = b'testdata'

        s = f.serialize()
        assert s == self.payload
开发者ID:vivekanand1101,项目名称:hyperframe,代码行数:9,代码来源:test_hyperframe.py

示例3: test_connection_window_increments_appropriately

# 需要导入模块: from hyperframe.frame import DataFrame [as 别名]
# 或者: from hyperframe.frame.DataFrame import flags [as 别名]
    def test_connection_window_increments_appropriately(self, frame_buffer):
        e = Encoder()
        h = HeadersFrame(1)
        h.data = e.encode([(':status', 200), ('content-type', 'foo/bar')])
        h.flags = set(['END_HEADERS'])
        d = DataFrame(1)
        d.data = b'hi there sir'
        d2 = DataFrame(1)
        d2.data = b'hi there sir again'
        d2.flags = set(['END_STREAM'])
        sock = DummySocket()
        sock.buffer = BytesIO(h.serialize() + d.serialize() + d2.serialize())

        c = HTTP20Connection('www.google.com')
        c._sock = sock
        c.window_manager.window_size = 1000
        c.window_manager.initial_window_size = 1000
        c.request('GET', '/')
        resp = c.get_response()
        resp.read()

        frame_buffer.add_data(b''.join(sock.queue))
        queue = list(frame_buffer)
        assert len(queue) == 3  # one headers frame, two window update frames.
        assert isinstance(queue[1], WindowUpdateFrame)
        assert queue[1].window_increment == len(b'hi there sir')
        assert isinstance(queue[2], WindowUpdateFrame)
        assert queue[2].window_increment == len(b'hi there sir again')
开发者ID:SecretObsession,项目名称:hyper,代码行数:30,代码来源:test_hyper.py

示例4: test_data_frame_with_padding_serializes_properly

# 需要导入模块: from hyperframe.frame import DataFrame [as 别名]
# 或者: from hyperframe.frame.DataFrame import flags [as 别名]
    def test_data_frame_with_padding_serializes_properly(self):
        f = DataFrame(1)
        f.flags = set(['END_STREAM', 'PADDED'])
        f.data = b'testdata'
        f.pad_length = 10

        s = f.serialize()
        assert s == self.payload_with_padding
开发者ID:vivekanand1101,项目名称:hyperframe,代码行数:10,代码来源:test_hyperframe.py

示例5: build_data_frame

# 需要导入模块: from hyperframe.frame import DataFrame [as 别名]
# 或者: from hyperframe.frame.DataFrame import flags [as 别名]
 def build_data_frame(self, data, flags=None, stream_id=1):
     """
     Builds a single data frame out of a chunk of data.
     """
     flags = set(flags) if flags is not None else set()
     f = DataFrame(stream_id)
     f.data = data
     f.flags = flags
     return f
开发者ID:k13gomez,项目名称:hyper-h2,代码行数:11,代码来源:helpers.py

示例6: build_data_frame

# 需要导入模块: from hyperframe.frame import DataFrame [as 别名]
# 或者: from hyperframe.frame.DataFrame import flags [as 别名]
    def build_data_frame(self, data, flags=None, stream_id=1, padding_len=0):
        """
        Builds a single data frame out of a chunk of data.
        """
        flags = set(flags) if flags is not None else set()
        f = DataFrame(stream_id)
        f.data = data
        f.flags = flags

        if padding_len:
            flags.add('PADDED')
            f.pad_length = padding_len

        return f
开发者ID:Mec-iS,项目名称:hyper-h2,代码行数:16,代码来源:helpers.py


注:本文中的hyperframe.frame.DataFrame.flags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。