style: separate different tests

This commit is contained in:
Xyphuz 2022-05-19 00:38:42 +08:00
parent f864346828
commit ecdc76a2a1

View file

@ -3,14 +3,24 @@ import pytest
from compose_viz.extends import Extends from compose_viz.extends import Extends
def test_extend_init(): def test_extend_init_normal():
try: try:
Extends(service_name="frontend", from_file="tests/in/000001.yaml") Extends(service_name="frontend", from_file="tests/in/000001.yaml")
assert True
except Exception as e:
assert False, e
def test_extend_init_without_from_file():
try:
Extends(service_name="frontend") Extends(service_name="frontend")
assert True assert True
except Exception as e: except Exception as e:
assert False, e assert False, e
def test_extend_init_without_service_name():
with pytest.raises(TypeError): with pytest.raises(TypeError):
Extends(from_file="tests/in/000001.yaml") # type: ignore Extends(from_file="tests/in/000001.yaml") # type: ignore