This repository has been archived on 2026-11-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
WGTools-Extended/tests/test_public_bootstrap.py
asminme affe28ad71
Wydanie WGTools-Extended / release (push) Failing after 16s
1.0.0
2026-10-30 00:35:08 +01:00

22 lines
851 B
Python

"""The bootstrap runs the local installer and never downloads upstream code."""
from pathlib import Path
import shutil
import subprocess
import pytest
ROOT = Path(__file__).resolve().parents[1]
def test_bootstrap_uses_local_source(tmp_path):
bash = shutil.which('bash')
if not bash:
pytest.skip('bash is required')
source = tmp_path / 'source'
(source / 'scripts').mkdir(parents=True)
shutil.copyfile(ROOT / 'install.sh', source / 'install.sh')
(source / 'scripts' / 'install.sh').write_text('#!/bin/sh\nprintf "local installer: %s" "$1"\n', encoding='utf-8')
result = subprocess.run([bash, str(source / 'install.sh'), 'test'], capture_output=True, text=True, check=True)
assert result.stdout == 'local installer: test'
assert 'KindMich/WGTools' not in (ROOT / 'install.sh').read_text(encoding='utf-8')