def test_invalid_solaris_disk_names_begin(self, name): ''' Test with solaris disk names and similar names. ''' with pytest.raises(ValidationError) as excinfo: validate_pool_name(name) assert 'begins with reserved sequence' in str(excinfo.value)
def test_too_short(self): ''' Tests with a name that we know is too short. ''' with pytest.raises(ValidationError) as excinfo: validate_pool_name('') assert 'too short' in str(excinfo.value)
def test_invalid_begins_with_reserved_keyword(self, name): ''' Tests with strings that are known to be reserved starts of the name. ''' with pytest.raises(ValidationError) as excinfo: validate_pool_name(name) assert 'starts with invalid token' in str(excinfo.value)
def test_invalid_reserved_keyword(self, name): ''' Tests with reserved keywords. ''' with pytest.raises(ValidationError) as excinfo: validate_pool_name(name) assert 'reserved name' in str(excinfo.value)
def test_invalid_name(self, name): ''' Tests a set of known bad combinations. ''' with pytest.raises(ValidationError) as excinfo: validate_pool_name(name) assert 'malformed name' in str(excinfo.value)
def test_valid_keyword_begin_extra(self): ''' Of the reserved keywords, 'log' is allowed as beginning of the pool name, check that it is allowed. ''' validate_pool_name('logger')
def test_valid_name(self, name): ''' Tests a set of known good combinations. ''' validate_pool_name(name)