compose-viz/tests/test_port.py

24 lines
619 B
Python
Raw Normal View History

2022-05-21 17:00:20 +02:00
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"
2022-05-24 10:02:47 +02:00
assert p.protocol == Protocol.any
2022-05-21 17:00:20 +02:00
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