Archived
1 parent
f5bdd7e21c
commit
affe28ad71
110 files changed
+52936
-14
No files matched your search
@@ -0,0 +1,21 @@
|
||||
"""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')
|
||||
Reference in new issue
Block a user