test: change ValueError to AttributeError in Service initialization
This commit is contained in:
parent
5349155622
commit
82e7951444
1 changed files with 4 additions and 2 deletions
|
@ -5,11 +5,13 @@ from compose_viz.service import Service
|
||||||
|
|
||||||
|
|
||||||
def test_service_init() -> None:
|
def test_service_init() -> None:
|
||||||
with pytest.raises(ValueError, match=r"Both image and extends are not defined in service 'frontend', aborting."):
|
with pytest.raises(
|
||||||
|
AttributeError, match=r"Both image and extends are not defined in service 'frontend', aborting."
|
||||||
|
):
|
||||||
Service(name="frontend")
|
Service(name="frontend")
|
||||||
|
|
||||||
with pytest.raises(
|
with pytest.raises(
|
||||||
ValueError, match=r"Only one of image and extends can be defined in service 'frontend', aborting."
|
AttributeError, match=r"Only one of image and extends can be defined in service 'frontend', aborting."
|
||||||
):
|
):
|
||||||
Service(
|
Service(
|
||||||
name="frontend", image="image", extends=Extends(service_name="frontend", from_file="tests/in/000001.yaml")
|
name="frontend", image="image", extends=Extends(service_name="frontend", from_file="tests/in/000001.yaml")
|
||||||
|
|
Loading…
Reference in a new issue