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


Python Parser.stopLengthCheck方法代码示例

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


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

示例1: test_setLengthCheck_with_bad_data

# 需要导入模块: from tlslite.utils.codec import Parser [as 别名]
# 或者: from tlslite.utils.codec.Parser import stopLengthCheck [as 别名]
    def test_setLengthCheck_with_bad_data(self):
        p = Parser(bytearray(b"\x04" + b"\x00\x01" + b"\x00\x02"))

        p.setLengthCheck(7)
        self.assertEqual([1, 2], p.getVarList(2, 1))

        with self.assertRaises(SyntaxError):
            p.stopLengthCheck()
开发者ID:zeroleo12345,项目名称:tlslite,代码行数:10,代码来源:test_tlslite_utils_codec.py

示例2: test_lengthCheck_with_incorrect_parsing

# 需要导入模块: from tlslite.utils.codec import Parser [as 别名]
# 或者: from tlslite.utils.codec.Parser import stopLengthCheck [as 别名]
    def test_lengthCheck_with_incorrect_parsing(self):
        p = Parser(bytearray(b"\x06" + b"\x00\x00" + b"\x02" + b"\x01\x02" + b"\x03"))

        p.startLengthCheck(1)
        self.assertEqual([0, 0], p.getFixList(1, 2))
        self.assertEqual([1, 2], p.getVarList(1, 1))
        with self.assertRaises(SyntaxError):
            p.stopLengthCheck()
开发者ID:zeroleo12345,项目名称:tlslite,代码行数:10,代码来源:test_tlslite_utils_codec.py

示例3: test_atLengthCheck

# 需要导入模块: from tlslite.utils.codec import Parser [as 别名]
# 或者: from tlslite.utils.codec.Parser import stopLengthCheck [as 别名]
    def test_atLengthCheck(self):
        p = Parser(bytearray(b"\x00\x06" + b"\x05" + b"\x01\xff" + b"\x07" + b"\x01\xf0"))

        p.startLengthCheck(2)
        while not p.atLengthCheck():
            p.get(1)
            p.getVarBytes(1)
        p.stopLengthCheck()
开发者ID:zeroleo12345,项目名称:tlslite,代码行数:10,代码来源:test_tlslite_utils_codec.py

示例4: test_lengthCheck

# 需要导入模块: from tlslite.utils.codec import Parser [as 别名]
# 或者: from tlslite.utils.codec.Parser import stopLengthCheck [as 别名]
    def test_lengthCheck(self):
        p = Parser(bytearray(b"\x06" + b"\x00\x00" + b"\x03" + b"\x01\x02\x03"))

        p.startLengthCheck(1)

        self.assertEqual([0, 0], p.getFixList(1, 2))
        self.assertEqual([1, 2, 3], p.getVarList(1, 1))
        # should not raise exception
        p.stopLengthCheck()
开发者ID:zeroleo12345,项目名称:tlslite,代码行数:11,代码来源:test_tlslite_utils_codec.py

示例5: test_setLengthCheck

# 需要导入模块: from tlslite.utils.codec import Parser [as 别名]
# 或者: from tlslite.utils.codec.Parser import stopLengthCheck [as 别名]
    def test_setLengthCheck(self):
        p = Parser(bytearray(
            b'\x06' +
            b'\x00\x01' +
            b'\x00\x02' +
            b'\x00\x03'
            ))

        p.setLengthCheck(7)
        self.assertEqual([1,2,3], p.getVarList(2,1))
        p.stopLengthCheck()
开发者ID:tomato42,项目名称:tlslite-ng,代码行数:13,代码来源:test_tlslite_utils_codec.py

示例6: test_atLengthCheck

# 需要导入模块: from tlslite.utils.codec import Parser [as 别名]
# 或者: from tlslite.utils.codec.Parser import stopLengthCheck [as 别名]
    def test_atLengthCheck(self):
        p = Parser(bytearray(
            b'\x00\x06' +
            b'\x05' +
            b'\x01\xff' +
            b'\x07' +
            b'\x01\xf0'
            ))

        p.startLengthCheck(2)
        while not p.atLengthCheck():
            p.get(1)
            p.getVarBytes(1)
        p.stopLengthCheck()
开发者ID:tomato42,项目名称:tlslite-ng,代码行数:16,代码来源:test_tlslite_utils_codec.py

示例7: test_setLengthCheck

# 需要导入模块: from tlslite.utils.codec import Parser [as 别名]
# 或者: from tlslite.utils.codec.Parser import stopLengthCheck [as 别名]
    def test_setLengthCheck(self):
        p = Parser(bytearray(b"\x06" + b"\x00\x01" + b"\x00\x02" + b"\x00\x03"))

        p.setLengthCheck(7)
        self.assertEqual([1, 2, 3], p.getVarList(2, 1))
        p.stopLengthCheck()
开发者ID:zeroleo12345,项目名称:tlslite,代码行数:8,代码来源:test_tlslite_utils_codec.py


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