def test_ack_setting_frame(): frame = SettingFrame(is_ack=True) try: frame.set(SettingFrame.SETTINGS_HEADER_TABLE_SIZE, 100) except: pass else: assert 0 # Exception was not raised read_frame = Frame.load(frame.get_frame_bin()) assert read_frame.is_ack
def test_setting_frame_data(): frame = SettingFrame() frame.set(SettingFrame.SETTINGS_HEADER_TABLE_SIZE, 100) frame.set(SettingFrame.SETTINGS_ENABLE_PUSH, 1) assert frame.type == FrameType.SETTINGS read_frame = Frame.load(frame.get_frame_bin()) assert read_frame.get(SettingFrame.SETTINGS_HEADER_TABLE_SIZE) == 100 assert read_frame.get(SettingFrame.SETTINGS_ENABLE_PUSH) == 1