save progress
This commit is contained in:
@@ -188,3 +188,51 @@ def test_value_number_out_of_limit(value_num, attr_type):
|
||||
)
|
||||
with pytest.raises(ParseError):
|
||||
Dictionary("", dictionary)
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("datatype", [
|
||||
"string", "octets", "abinary", "byte", "short",
|
||||
"integer", "signed", "integer64", "ipaddr",
|
||||
"ipv4prefix", "ipv6addr", "ipv6prefix", "combo-ip",
|
||||
"ifid", "ether", "concat", "tlv", "extended",
|
||||
"long-extended", "evs",
|
||||
])
|
||||
def test_all_datatypes_rfc_space(datatype):
|
||||
dictionary = StringIO(
|
||||
f"ATTRIBUTE TEST-ATTRIBUTE 1 {datatype}\n"
|
||||
)
|
||||
Dictionary("", dictionary)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("datatype", [
|
||||
"string", "octets", "abinary", "byte", "short",
|
||||
"integer", "signed", "integer64", "ipaddr",
|
||||
"ipv4prefix", "ipv6addr", "ipv6prefix", "combo-ip",
|
||||
"ifid", "ether", "tlv",
|
||||
])
|
||||
def test_valid_datatypes_in_vendor_space(datatype):
|
||||
dictionary = StringIO(
|
||||
"VENDOR TEST 1234\n"
|
||||
"BEGIN-VENDOR TEST\n"
|
||||
f"ATTRIBUTE TEST-ATTRIBUTE 1 {datatype}\n"
|
||||
"END-VENDOR TEST\n"
|
||||
)
|
||||
Dictionary("", dictionary)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("datatype", [
|
||||
"concat", "extended", "long-extended", "evs",
|
||||
])
|
||||
def test_invalid_datatypes_in_vendor_space(datatype):
|
||||
dictionary = StringIO(
|
||||
"VENDOR TEST 1234\n"
|
||||
"BEGIN-VENDOR TEST\n"
|
||||
f"ATTRIBUTE TEST-ATTRIBUTE 1 {datatype}\n"
|
||||
"END-VENDOR TEST\n"
|
||||
)
|
||||
with pytest.raises(ParseError):
|
||||
Dictionary("", dictionary)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user