Ejemplo n.º 1
0
def test_dns_server_list_combined():
    """Test a list with both v4 and v6 addresses."""
    combined = DNS_GOOD_V4 + DNS_GOOD_V6
    # test the matches
    assert validate.dns_server_list(combined)
    # test max_length is OK still
    assert validate.dns_server_list(combined)
    # test that it fails when the list is too long
    with pytest.raises(vol.error.Invalid):
        validate.dns_server_list(combined + combined + combined + combined)
Ejemplo n.º 2
0
def test_dns_server_list_bad_combined():
    """Test the bad list, combined with the good."""
    combined = DNS_GOOD_V4 + DNS_GOOD_V6 + DNS_BAD

    with pytest.raises(vol.error.Invalid):
        # bad list
        assert validate.dns_server_list(combined)
Ejemplo n.º 3
0
def test_dns_server_list_bad():
    """Test the bad list."""
    # test the matches
    with pytest.raises(vol.error.Invalid):
        assert validate.dns_server_list(DNS_BAD)
Ejemplo n.º 4
0
def test_dns_server_list_v6():
    """Test a list with v6 addresses."""
    assert validate.dns_server_list(DNS_GOOD_V6)
Ejemplo n.º 5
0
def test_dns_server_list_v6():
    """Test a list with v6 addresses."""
    with pytest.raises(vol.error.Invalid):
        assert validate.dns_server_list(DNS_GOOD_V6)