test: update test_extends.py
This commit is contained in:
parent
58cf1c63b5
commit
d1ae549d48
1 changed files with 14 additions and 1 deletions
|
@ -1,6 +1,19 @@
|
||||||
import pytest
|
import pytest
|
||||||
|
from compose_viz.extends import Extends
|
||||||
from compose_viz.service import Service
|
from compose_viz.service import Service
|
||||||
|
|
||||||
def test_parse_file():
|
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():
|
||||||
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')
|
||||||
|
|
Loading…
Reference in a new issue