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:
Karol Duleba 2015-08-10 23:16:55 +01:00
commit 2e7f08c2ef
3 changed files with 18 additions and 1 deletions

View file

@ -0,0 +1,4 @@
web:
image: busybox
extends:
service: foo

View file

@ -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):