compose-viz/tests/test_extends.py

27 lines
582 B
Python
Raw Normal View History

2022-05-18 09:12:24 +02:00
import pytest
2022-05-18 17:28:18 +02:00
2022-05-18 09:24:51 +02:00
from compose_viz.extends import Extends
2022-05-18 17:28:18 +02:00
2022-05-18 18:41:08 +02:00
def test_extend_init_normal() -> None:
2022-05-18 09:24:51 +02:00
try:
2022-05-18 17:28:18 +02:00
Extends(service_name="frontend", from_file="tests/in/000001.yaml")
2022-05-18 18:38:42 +02:00
assert True
except Exception as e:
assert False, e
2022-05-18 18:41:08 +02:00
def test_extend_init_without_from_file() -> None:
2022-05-18 18:38:42 +02:00
try:
2022-05-18 17:28:18 +02:00
Extends(service_name="frontend")
2022-05-18 09:24:51 +02:00
assert True
2022-05-18 17:28:18 +02:00
except Exception as e:
assert False, e
2022-05-18 09:24:51 +02:00
2022-05-18 18:38:42 +02:00
2022-05-18 18:41:08 +02:00
def test_extend_init_without_service_name() -> None:
2022-05-18 09:24:51 +02:00
with pytest.raises(TypeError):
2022-05-18 17:28:18 +02:00
Extends(from_file="tests/in/000001.yaml") # type: ignore