Make the different linting tools happy
This commit is contained in:
26
tests/test_parse_header.py
Normal file
26
tests/test_parse_header.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Copyright 2020 Istvan Ruzman
|
||||
# SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
|
||||
import struct
|
||||
|
||||
from pyrad3 import utils
|
||||
import pytest
|
||||
|
||||
# @pytest.mark.parametrize("header", [
|
||||
# b""])
|
||||
# def test_valid_header(header):
|
||||
# utils.parse_header(header)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"header",
|
||||
[
|
||||
b"\1\0" + struct.pack("!H", 5000) + 4996 * b"\0",
|
||||
b"\1\0" + struct.pack("!H", 100),
|
||||
b"\0\0" + struct.pack("!H", 20) + 16 * b"\0",
|
||||
b"",
|
||||
],
|
||||
)
|
||||
def test_invalid_header(header):
|
||||
with pytest.raises(utils.PacketError):
|
||||
utils.parse_header(header)
|
||||
Reference in New Issue
Block a user