diff --git a/tests/in/000100.yaml b/tests/in/000100.yaml index c68c007..058aa18 100644 --- a/tests/in/000100.yaml +++ b/tests/in/000100.yaml @@ -3,6 +3,6 @@ services: web: build: . ports: - - "8000:5000" + - "8080" redis: image: "redis:alpine" diff --git a/tests/in/000101.yaml b/tests/in/000101.yaml index 6eb5b7f..a92a5f1 100644 --- a/tests/in/000101.yaml +++ b/tests/in/000101.yaml @@ -2,7 +2,10 @@ services: frontend: image: awesome/webapp ports: - - "8000:5000" + - target: 80 + host_ip: 127.0.0.1 + published: 8080 + protocol: udp networks: - front-tier - back-tier @@ -10,14 +13,14 @@ services: monitoring: image: awesome/monitoring ports: - - "8000:5001" + - "127.0.0.1:8081:5001" networks: - admin backend: image: awesome/backend ports: - - "8000:5010" + - "8000:5010/udp" networks: back-tier: aliases: diff --git a/tests/in/000110.yaml b/tests/in/000110.yaml index d67632a..ff82c1c 100644 --- a/tests/in/000110.yaml +++ b/tests/in/000110.yaml @@ -2,7 +2,7 @@ services: frontend: image: awesome/webapp ports: - - "8000:5000" + - target: 80 monitoring: extends: diff --git a/tests/in/010000.yaml b/tests/in/010000.yaml index 2b61286..1040482 100644 --- a/tests/in/010000.yaml +++ b/tests/in/010000.yaml @@ -2,11 +2,7 @@ services: backend: image: awesome/backend volumes: - - type: volume - source: db-data - target: /data - volume: - nocopy: true + - "db-data:/data" - type: bind source: /var/run/postgres/postgres.sock target: /var/run/postgres/postgres.sock diff --git a/tests/test_parse_file.py b/tests/test_parse_file.py index 8dc3dbf..e4fe9c7 100644 --- a/tests/test_parse_file.py +++ b/tests/test_parse_file.py @@ -3,7 +3,7 @@ import pytest from compose_viz.compose import Compose from compose_viz.extends import Extends from compose_viz.parser import Parser -from compose_viz.port import Port +from compose_viz.port import Port, Protocol from compose_viz.service import Service from compose_viz.volume import AccessMode, Volume, VolumeType @@ -82,7 +82,7 @@ from compose_viz.volume import AccessMode, Volume, VolumeType name="web", image="build from .", ports=[ - Port(host_port="8000", container_port="5000"), + Port(host_port="8080", container_port="8080"), ], ), Service( @@ -100,7 +100,7 @@ from compose_viz.volume import AccessMode, Volume, VolumeType name="frontend", image="awesome/webapp", ports=[ - Port(host_port="8000", container_port="5000"), + Port(host_port="127.0.0.1:8080", container_port="80", protocol=Protocol.udp), ], networks=["front-tier", "back-tier"], ), @@ -108,7 +108,7 @@ from compose_viz.volume import AccessMode, Volume, VolumeType name="monitoring", image="awesome/monitoring", ports=[ - Port(host_port="8000", container_port="5001"), + Port(host_port="127.0.0.1:8081", container_port="5001"), ], networks=["admin"], ), @@ -116,7 +116,7 @@ from compose_viz.volume import AccessMode, Volume, VolumeType name="backend", image="awesome/backend", ports=[ - Port(host_port="8000", container_port="5010"), + Port(host_port="8000", container_port="5010", protocol=Protocol.udp), ], networks=["back-tier", "admin"], ), @@ -131,7 +131,7 @@ from compose_viz.volume import AccessMode, Volume, VolumeType name="frontend", image="awesome/webapp", ports=[ - Port(host_port="8000", container_port="5000"), + Port(host_port="80", container_port="80"), ], ), Service(