Merge "Add possiblity to use generator in environment config"

This commit is contained in:
Jenkins 2016-04-08 13:00:16 +00:00 committed by Gerrit Code Review
commit d5076501a0
2 changed files with 17 additions and 1 deletions

View File

@ -184,6 +184,17 @@ class BaseValidator(BaseTestCase):
"of type 'string', value path 'attributes -> key1 -> type'"): "of type 'string', value path 'attributes -> key1 -> type'"):
self.validator.check_env_config_attrs() self.validator.check_env_config_attrs()
def test_check_env_config_attrs_generator_value(self, utils_mock):
utils_mock.parse_yaml.return_value = {
'attributes': {
'key1': {
'type': 'hidden',
'label': '',
'value': {'generator': 'password'},
'weight': 1}}}
self.validator.check_env_config_attrs()
def test_check_env_config_attrs_restriction_fails(self, utils_mock): def test_check_env_config_attrs_restriction_fails(self, utils_mock):
utils_mock.parse_yaml.return_value = { utils_mock.parse_yaml.return_value = {
'attributes': { 'attributes': {

View File

@ -169,7 +169,12 @@ class BaseSchema(object):
'properties': { 'properties': {
'type': {'type': 'string'}, 'type': {'type': 'string'},
'weight': {'type': 'integer'}, 'weight': {'type': 'integer'},
'value': {'type': ['string', 'boolean']}, 'value': {'anyOf': [
{'type': 'string'},
{'type': 'boolean'},
{'type': 'object',
'properties': {'generator': {'type': 'string'}}}
]},
'label': {'type': 'string'}, 'label': {'type': 'string'},
'restrictions': self.restrictions, 'restrictions': self.restrictions,
'values': {'type': 'array', 'items': 'values': {'type': 'array', 'items':