dcos-2524: give more helpful error message for wrong property

This commit is contained in:
Tamar Ben-Shachar
2015-08-05 12:37:41 -07:00
parent 27fdebaf23
commit 8712c4a0b8
3 changed files with 6 additions and 6 deletions

View File

@@ -361,8 +361,8 @@ def test_update_missing_field():
assert returncode == 1
assert stdout == b''
assert stderr.decode('utf-8').startswith(
"The property 'missing' does not conform to the expected format. "
"Possible values are: ")
"Error: 'missing' is not a valid property. "
"Possible properties are: ")
def test_update_bad_type():

View File

@@ -119,8 +119,8 @@ def test_update_missing_field():
assert returncode == 1
assert stdout == b''
assert stderr.decode('utf-8').startswith(
"The property 'missing' does not conform to the expected format. "
"Possible values are: ")
"Error: 'missing' is not a valid property. "
"Possible properties are: ")
def _remove_group(group_id):

View File

@@ -59,8 +59,8 @@ def find_parser(key, schema):
if key_schema is None:
keys = ', '.join(schema['properties'].keys())
raise DCOSException(
'The property {!r} does not conform to the expected format. '
'Possible values are: {}'.format(key, keys))
'Error: {!r} is not a valid property. '
'Possible properties are: {}'.format(key, keys))
else:
return ValueTypeParser(key_schema)