Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ claude --version
#### Linux / WSL

```bash
# Installation via script
curl -fsSL https://install.claude.com | sh
# Installation via le script officiel (binaire natif, Node.js non requis)
curl -fsSL https://claude.ai/install.sh | bash

# Ajouter au PATH (si necessaire)
echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Si "claude --version" reste introuvable apres avoir rouvert le terminal :
# echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
```

Le binaire natif vit sous `~/.local/bin` (cf. encadré ci-dessus) et les installations natives se mettent à jour automatiquement en arrière-plan. Source consultée le 2026-09-12 : [code.claude.com/docs/en/quickstart](https://code.claude.com/docs/en/quickstart).

**Verification :**

```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,35 @@ def test_verify_installation_false_when_not_in_path(monkeypatch):


def test_verify_installation_true_when_in_path(monkeypatch):
# Hermetic: mock BOTH layers -- shutil.which resolves the binary AND
# subprocess.run answers -- so the verdict never depends on a real CLI
# installed on the host running the suite (#15672).
monkeypatch.setattr(claude_cli.shutil, "which", lambda cmd: "/usr/local/bin/claude")

class _FakeOk:
returncode = 0
stdout = "1.0.100 (Claude Code)\n"
stderr = ""

monkeypatch.setattr(claude_cli.subprocess, "run", lambda *a, **k: _FakeOk())
assert claude_cli.verify_installation() is True


def test_verify_installation_false_when_run_fails(monkeypatch):
# Falsification companion: same PATH hit, failing '--version' run.
# Proves the True verdict above depends on execution, not on
# shutil.which alone.
monkeypatch.setattr(claude_cli.shutil, "which", lambda cmd: "/usr/local/bin/claude")

class _FakeFail:
returncode = 127
stdout = ""
stderr = "command failed"

monkeypatch.setattr(claude_cli.subprocess, "run", lambda *a, **k: _FakeFail())
assert claude_cli.verify_installation() is False


# --------------------------------------------------------------------------
# run_claude — SIMULATION_MODE (deterministic)
# --------------------------------------------------------------------------
Expand Down
Loading