import subprocess
from pathlib import Path
from conftest import get_bin_path, run_clyde, run_in_clyde_home, IS_WINDOWS
def test_install_without_setup_show_message(clyde_home, monkeypatch):
clyde_bin_path = get_bin_path("clyde")
monkeypatch.setenv("CLYDE_HOME", "/does/not/exist")
result = subprocess.run([clyde_bin_path, "update"], capture_output=True, text=True)
assert result.returncode != 0
assert "clyde setup" in result.stderr
def test_setup_installed_clyde(clyde_home):
if IS_WINDOWS:
cmd = "cygpath -w $(which clyde)"
else:
cmd = "which clyde"
proc = run_in_clyde_home(cmd)
clyde_path = Path(proc.stdout.strip())
assert clyde_path == get_bin_path("clyde")