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])
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'])
def test_hostname_validation_success(): """ Test function returns True if valid hostnames are specified """ assert valid_hostnames(['example.com', 'example'])