Fix validation message when there are multiple ested oneOf validations.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
1f2c2942d7
commit
02535f0cf1
2 changed files with 25 additions and 0 deletions
|
|
@ -371,6 +371,27 @@ class ConfigTest(unittest.TestCase):
|
|||
error_msg = "service 'web' doesn't have any configuration options"
|
||||
assert error_msg in exc.exconly()
|
||||
|
||||
def test_load_with_empty_build_args(self):
|
||||
config_details = build_config_details(
|
||||
{
|
||||
'version': '2',
|
||||
'services': {
|
||||
'web': {
|
||||
'build': {
|
||||
'context': '.',
|
||||
'args': None,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
with pytest.raises(ConfigurationError) as exc:
|
||||
config.load(config_details)
|
||||
assert (
|
||||
"services.web.build.args contains an invalid type, it should be an "
|
||||
"array, or an object" in exc.exconly()
|
||||
)
|
||||
|
||||
def test_config_integer_service_name_raise_validation_error(self):
|
||||
with pytest.raises(ConfigurationError) as excinfo:
|
||||
config.load(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue