示例#1
0
def test_protocols_with_string_mixed():
    names = ['ip4']
    ins = "/".join(names)
    test_protocols_with_string(names)
    with pytest.raises(ValueError):
        names.append("foo")
        ins = "/".join(names)
        protocols.protocols_with_string(ins)
示例#2
0
def test_protocols_with_string_mixed():
    names = ['ip4']
    ins = "/".join(names)
    test_protocols_with_string(names)
    with pytest.raises(exceptions.ProtocolNotFoundError):
        names.append("foo")
        ins = "/".join(names)
        protocols.protocols_with_string(ins)
示例#3
0
def test_invalid_protocols_with_string(proto_string):
    with pytest.raises(ValueError):
        protocols_with_string(proto_string)
示例#4
0
def test_protocols_with_string(proto_string, expected):
    protos = protocols_with_string(proto_string)
    assert protos == expected
示例#5
0
def test_invalid_protocols_with_string(proto_string):
    with pytest.raises(ProtocolNotFoundError):
        protocols_with_string(proto_string)
示例#6
0
def test_protocols_with_string(names):
    expected = [protocols.protocol_with_name(name) for name in names]
    ins = "/".join(names)
    assert protocols.protocols_with_string(ins) == expected
    assert protocols.protocols_with_string("/" + ins) == expected
    assert protocols.protocols_with_string("/" + ins + "/") == expected
示例#7
0
def test_protocols_with_string_invalid(invalid_name):
    assert protocols.protocols_with_string(invalid_name) == []
示例#8
0
def test_invalid_protocols_with_string(proto_string):
    with pytest.raises(ProtocolNotFoundError):
        protocols_with_string(proto_string)
示例#9
0
def test_protocols_with_string(proto_string, expected):
    protos = protocols_with_string(proto_string)
    assert protos == expected
示例#10
0
def test_invalid_protocols_with_string(proto_string):
    with pytest.raises(ValueError):
        protocols_with_string(proto_string)