Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
def test_invalid_protocols_with_string(proto_string):
    with pytest.raises(ValueError):
        protocols_with_string(proto_string)
Exemplo n.º 4
0
def test_protocols_with_string(proto_string, expected):
    protos = protocols_with_string(proto_string)
    assert protos == expected
Exemplo n.º 5
0
def test_invalid_protocols_with_string(proto_string):
    with pytest.raises(ProtocolNotFoundError):
        protocols_with_string(proto_string)
Exemplo n.º 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
Exemplo n.º 7
0
def test_protocols_with_string_invalid(invalid_name):
    assert protocols.protocols_with_string(invalid_name) == []
Exemplo n.º 8
0
def test_invalid_protocols_with_string(proto_string):
    with pytest.raises(ProtocolNotFoundError):
        protocols_with_string(proto_string)
Exemplo n.º 9
0
def test_protocols_with_string(proto_string, expected):
    protos = protocols_with_string(proto_string)
    assert protos == expected
Exemplo n.º 10
0
def test_invalid_protocols_with_string(proto_string):
    with pytest.raises(ValueError):
        protocols_with_string(proto_string)