26 lines
1.3 KiB
Python
26 lines
1.3 KiB
Python
from pathlib import Path
|
|
|
|
|
|
NEXUS_ROOT = Path(__file__).resolve().parent.parent
|
|
|
|
|
|
def test_deploy_sh_header_comments_match_live_ports():
|
|
deploy_sh = (NEXUS_ROOT / "deploy.sh").read_text()
|
|
assert "(port 8765)" in deploy_sh, "deploy.sh should document nexus-main on port 8765"
|
|
assert "(port 8766)" in deploy_sh, "deploy.sh should document nexus-staging on port 8766"
|
|
assert "4200" not in deploy_sh, "stale 4200 comment should not remain in deploy.sh"
|
|
assert "4201" not in deploy_sh, "stale 4201 comment should not remain in deploy.sh"
|
|
|
|
|
|
def test_deploy_sh_comments_match_docker_compose_bindings():
|
|
deploy_sh = (NEXUS_ROOT / "deploy.sh").read_text().splitlines()
|
|
compose = (NEXUS_ROOT / "docker-compose.yml").read_text()
|
|
|
|
main_comment = next(line for line in deploy_sh if "nexus-main" in line and "port" in line)
|
|
staging_comment = next(line for line in deploy_sh if "nexus-staging" in line and "port" in line)
|
|
|
|
assert '"8765:8765"' in compose, "docker-compose should expose nexus-main on 8765"
|
|
assert '"8766:8765"' in compose, "docker-compose should expose nexus-staging via host port 8766"
|
|
assert "8765" in main_comment, "nexus-main deploy comment should cite 8765"
|
|
assert "8766" in staging_comment, "nexus-staging deploy comment should cite 8766"
|