fix(reddit): install rdt-cli from GitHub source pinned to 0.4.2 (#326)
PyPI still only has rdt-cli 0.4.1 while the doctor hint required >=0.4.2, so the suggested install command always failed. Installs from the upstream GitHub repo pinned to the 0.4.2 commit instead, and syncs all four docs that still taught the PyPI path. Verified locally: clean-venv install from the pinned source yields rdt 0.4.2 and rdt status works. 86 tests pass. Fixes #294.
This commit is contained in:
@@ -654,6 +654,8 @@ class TestRedditChannel:
|
||||
assert status == "off"
|
||||
assert "rdt-cli" in msg
|
||||
assert "public-clis/rdt-cli" in msg
|
||||
assert "git+https://github.com/public-clis/rdt-cli.git" in msg
|
||||
assert "rdt-cli>=0.4.2" not in msg
|
||||
|
||||
def test_reports_ok_when_authenticated(self, monkeypatch):
|
||||
monkeypatch.setattr(shutil, "which", lambda _: "/usr/local/bin/rdt")
|
||||
|
||||
+29
-1
@@ -1,9 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Tests for Agent Reach CLI."""
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
from unittest.mock import patch
|
||||
import agent_reach.cli as cli
|
||||
from agent_reach.cli import main
|
||||
|
||||
@@ -42,6 +45,31 @@ class TestCLI:
|
||||
assert auth_token == "token123"
|
||||
assert ct0 == "ct0abc"
|
||||
|
||||
def test_install_reddit_deps_prefers_github_source(self, monkeypatch, capsys):
|
||||
state = {"rdt_installed": False}
|
||||
commands = []
|
||||
|
||||
def fake_which(name):
|
||||
if name == "rdt":
|
||||
return "/usr/local/bin/rdt" if state["rdt_installed"] else None
|
||||
if name == "pipx":
|
||||
return "/usr/local/bin/pipx"
|
||||
return None
|
||||
|
||||
def fake_run(cmd, **kwargs):
|
||||
commands.append(cmd)
|
||||
state["rdt_installed"] = True
|
||||
return subprocess.CompletedProcess(cmd, 0, "", "")
|
||||
|
||||
monkeypatch.setattr(shutil, "which", fake_which)
|
||||
monkeypatch.setattr(subprocess, "run", fake_run)
|
||||
|
||||
cli._install_reddit_deps()
|
||||
|
||||
out = capsys.readouterr().out
|
||||
assert commands == [["pipx", "install", cli._RDT_GIT_SOURCE]]
|
||||
assert "✅ rdt-cli installed" in out
|
||||
|
||||
|
||||
class TestCheckUpdateRetry:
|
||||
def test_retry_timeout_classification(self):
|
||||
|
||||
Reference in New Issue
Block a user