test: update test_service_init

This commit is contained in:
Xyphuz 2022-05-18 16:37:43 +08:00
parent 01aeb56189
commit c001420db0

View file

@ -17,3 +17,6 @@ def test_extend_init():
def test_service_init(): def test_service_init():
with pytest.raises(ValueError, match=r"Both image and extends are not defined in service 'frontend', aborting."): with pytest.raises(ValueError, match=r"Both image and extends are not defined in service 'frontend', aborting."):
Service(name='frontend') Service(name='frontend')
with pytest.raises(ValueError, match=r"Only one of image and extends can be defined in service '{name}', aborting."):
Service(name='frontend', image='image', extends=Extends(service_name='frontend', from_file='tests/in/000001.yaml'))