def test_can_validate_a_basic_hostname(self): hostame_validator = Hostname('validator') assert hostame_validator('myhost')
def test_can_validate_a_dotted_hostname_ending_with_a_dot(self): hostame_validator = Hostname('validator') assert hostame_validator('myhost.domain.')
def test_cannot_validate_a_hostname_taht_is_longer_than_255_characters( self): hostame_validator = Hostname('validator') with pytest.raises(ValueInvalid): hostame_validator('bad' * 100)
def test_can_validate_a_dotted_hostname(self): hostame_validator = Hostname('validator') assert hostame_validator('myhost.domain')