diff --git a/tests/test_port.py b/tests/test_port.py new file mode 100644 index 0000000..c7baf39 --- /dev/null +++ b/tests/test_port.py @@ -0,0 +1,23 @@ +from compose_viz.port import Port, Protocol + + +def test_port_init_normal() -> None: + try: + p = Port(host_port="8080", container_port="80") + + assert p.host_port == "8080" + assert p.container_port == "80" + assert p.protocol == Protocol.tcp + except Exception as e: + assert False, e + + +def test_port_with_protocol() -> None: + try: + p = Port(host_port="8080", container_port="80", protocol=Protocol.udp) + + assert p.host_port == "8080" + assert p.container_port == "80" + assert p.protocol == Protocol.udp + except Exception as e: + assert False, e diff --git a/tests/test_volume.py b/tests/test_volume.py index a58b56e..8081ae3 100644 --- a/tests/test_volume.py +++ b/tests/test_volume.py @@ -1,7 +1,7 @@ from compose_viz.volume import Volume, VolumeType -def test_extend_init_normal() -> None: +def test_volume_init_normal() -> None: try: v = Volume(source="./foo", target="./bar") @@ -12,7 +12,7 @@ def test_extend_init_normal() -> None: assert False, e -def test_extend_with_type() -> None: +def test_volume_with_type() -> None: try: v = Volume(source="./foo", target="./bar", type=VolumeType.bind)