diff --git a/tests/test_extends.py b/tests/test_extends.py index ef8f755..0bc6a0c 100644 --- a/tests/test_extends.py +++ b/tests/test_extends.py @@ -5,18 +5,20 @@ from compose_viz.extends import Extends def test_extend_init_normal() -> None: try: - Extends(service_name="frontend", from_file="tests/in/000001.yaml") + e = Extends(service_name="frontend", from_file="tests/in/000001.yaml") - assert True + assert e.service_name == "frontend" + assert e.from_file == "tests/in/000001.yaml" except Exception as e: assert False, e def test_extend_init_without_from_file() -> None: try: - Extends(service_name="frontend") + e = Extends(service_name="frontend") - assert True + assert e.service_name == "frontend" + assert e.from_file is None except Exception as e: assert False, e diff --git a/tests/test_volume.py b/tests/test_volume.py new file mode 100644 index 0000000..a58b56e --- /dev/null +++ b/tests/test_volume.py @@ -0,0 +1,23 @@ +from compose_viz.volume import Volume, VolumeType + + +def test_extend_init_normal() -> None: + try: + v = Volume(source="./foo", target="./bar") + + assert v.source == "./foo" + assert v.target == "./bar" + assert v.type == VolumeType.volume + except Exception as e: + assert False, e + + +def test_extend_with_type() -> None: + try: + v = Volume(source="./foo", target="./bar", type=VolumeType.bind) + + assert v.source == "./foo" + assert v.target == "./bar" + assert v.type == VolumeType.bind + except Exception as e: + assert False, e