compose-viz/tests/test_extends.py

20 lines
569 B
Python
Raw Normal View History

2022-05-18 09:12:24 +02:00
import pytest
2022-05-18 09:24:51 +02:00
from compose_viz.extends import Extends
2022-05-18 09:12:24 +02:00
from compose_viz.service import Service
2022-05-18 09:24:51 +02:00
def test_extend_init():
try:
Extends(service_name='frontend', from_file='tests/in/000001.yaml')
Extends(service_name='frontend')
assert True
except:
assert False
with pytest.raises(TypeError):
Extends(from_file='tests/in/000001.yaml')
def test_service_init():
2022-05-18 09:12:24 +02:00
with pytest.raises(ValueError, match=r"Both image and extends are not defined in service 'frontend', aborting."):
Service(name='frontend')