コード例 #1
0
def test_OBNAME_len_raises():
    ld = LogicalData(b'\x00' + b'\x01' + b'\x03')
    with pytest.raises(RepCode.ExceptionRepCode) as err:
        RepCode.OBNAME_len(ld.bytes, -1)
    assert err.value.args[0] == 'Index can not be negative.'
コード例 #2
0
def test_OBNAME_len(ld, expected):
    # TODO: index != 0, index -ve. Also for other _len functions.
    result = RepCode.OBNAME_len(ld.bytes, 0)
    assert result == expected