コード例 #1
0
ファイル: test_utils.py プロジェクト: twm/python-hosts
def test_hostname_validation_failure_too_long():
    """
    Test function returns False if a hostname over 255 chars is specified
    """
    long_hostname = 'x' * 256
    assert not valid_hostnames(['example.com', long_hostname])
コード例 #2
0
ファイル: test_utils.py プロジェクト: twm/python-hosts
def test_hostname_validation_failure_with_leading_hyphen():
    """
    Test function returns False if a hostname with a leading hyphen is specified
    """
    assert not valid_hostnames(['example.com', '-example'])
コード例 #3
0
ファイル: test_utils.py プロジェクト: twm/python-hosts
def test_hostname_validation_success():
    """
    Test function returns True if valid hostnames are specified
    """
    assert valid_hostnames(['example.com', 'example'])