mirror of
https://github.com/docker/compose.git
synced 2026-10-20 19:02:47 +00:00
Merge pull request #4529 from shin-/3528-invalid-service-name
Detect the service that causes the invalid service name error
This commit is contained in:
commit
7e8dcc847b
2 changed files with 20 additions and 3 deletions
|
|
@ -554,6 +554,20 @@ class ConfigTest(unittest.TestCase):
|
|||
excinfo.exconly()
|
||||
)
|
||||
|
||||
def test_config_invalid_service_name_raise_validation_error(self):
|
||||
with pytest.raises(ConfigurationError) as excinfo:
|
||||
config.load(
|
||||
build_config_details({
|
||||
'version': '2',
|
||||
'services': {
|
||||
'test_app': {'build': '.'},
|
||||
'mong\\o': {'image': 'mongo'},
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
assert 'Invalid service name \'mong\\o\'' in excinfo.exconly()
|
||||
|
||||
def test_load_with_multiple_files_v1(self):
|
||||
base_file = config.ConfigFile(
|
||||
'base.yaml',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue