save progress

This commit is contained in:
Istvan Ruzman
2020-08-07 10:02:34 +02:00
parent 8a5fc3d357
commit 9d7d40806a
6 changed files with 85 additions and 23 deletions

View File

@@ -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)