Raise configuration error when trying to extend service that does not exist. Fixes #1826
Signed-off-by: Karol Duleba <mr.fuxi@gmail.com>
This commit is contained in:
parent
7d5e26bd37
commit
2e7f08c2ef
3 changed files with 18 additions and 1 deletions
4
tests/fixtures/extends/nonexistent-service.yml
vendored
Normal file
4
tests/fixtures/extends/nonexistent-service.yml
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
web:
|
||||
image: busybox
|
||||
extends:
|
||||
service: foo
|
||||
|
|
@ -917,6 +917,11 @@ class ExtendsTest(unittest.TestCase):
|
|||
},
|
||||
])
|
||||
|
||||
def test_load_throws_error_when_base_service_does_not_exist(self):
|
||||
err_msg = r'''Cannot extend service 'foo' in .*: Service not found'''
|
||||
with self.assertRaisesRegexp(ConfigurationError, err_msg):
|
||||
load_from_filename('tests/fixtures/extends/nonexistent-service.yml')
|
||||
|
||||
|
||||
class BuildPathTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue