Exemplo n.º 1
0
def test_ipv6prefix_parameter():
    assert IPv6PrefixParameter().clean("::/128") == "::/128"
    assert IPv6PrefixParameter().clean("2001:db8::/32") == "2001:db8::/32"
    with pytest.raises(InterfaceTypeError):
        IPv6PrefixParameter().clean("2001:db8::/129")
    with pytest.raises(InterfaceTypeError):
        IPv6PrefixParameter().clean("2001:db8::/g")
    with pytest.raises(InterfaceTypeError):
        IPv6PrefixParameter().clean("2001:db8::")
Exemplo n.º 2
0
def test_ipv6prefix_parameter_error(raw, config):
    with pytest.raises(InterfaceTypeError):
        assert IPv6PrefixParameter(**config).clean(raw)
Exemplo n.º 3
0
def test_ipv6prefix_parameter(raw, config, expected):
    assert IPv6PrefixParameter(**config).clean(raw) == expected
Exemplo n.º 4
0
 def decode_ipv6_prefix(event, value):
     return IPv6PrefixParameter().clean(value)