refactor: drop workspace sync launcher path; simplify upgrade/switch
Align with xiaohe wheel/pip install: remove sync_workspace and desktop launcher coupling from upgrade/switch flows.
This commit is contained in:
+17
-15
@@ -3,16 +3,14 @@
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from click.testing import CliRunner
|
||||
|
||||
from myagents.commands import version as ver_mod
|
||||
|
||||
|
||||
class TestDescribeTree:
|
||||
def test_installed_runtime_tree(self) -> None:
|
||||
def test_legacy_runtime_tree(self) -> None:
|
||||
tree = Path("/home/u/.xiaohe/runtime/v1.2.3/contrib/myagents")
|
||||
mode, detail = ver_mod.describe_tree(tree)
|
||||
assert mode == "installed"
|
||||
assert mode == "legacy-runtime"
|
||||
assert detail == "v1.2.3"
|
||||
|
||||
def test_development_checkout(self, tmp_path: Path) -> None:
|
||||
@@ -33,16 +31,20 @@ class TestGitDescribe:
|
||||
repo.mkdir()
|
||||
subprocess.run(["git", "init", "-q"], cwd=repo, check=True)
|
||||
subprocess.run(
|
||||
["git", "-c", "user.email=t@t", "-c", "user.name=t",
|
||||
"commit", "-q", "--allow-empty", "-m", "init"],
|
||||
cwd=repo, check=True,
|
||||
[
|
||||
"git",
|
||||
"-c",
|
||||
"user.email=t@t",
|
||||
"-c",
|
||||
"user.name=t",
|
||||
"commit",
|
||||
"-q",
|
||||
"--allow-empty",
|
||||
"-m",
|
||||
"init",
|
||||
],
|
||||
cwd=repo,
|
||||
check=True,
|
||||
)
|
||||
result = ver_mod._git_describe(repo)
|
||||
assert "branch" in result
|
||||
|
||||
|
||||
class TestVersionCommand:
|
||||
def test_runs_and_reports(self) -> None:
|
||||
result = CliRunner().invoke(ver_mod.version_cmd)
|
||||
assert result.exit_code == 0
|
||||
assert "myagents" in result.output
|
||||
assert result != "unknown"
|
||||
|
||||
Reference in New Issue
Block a user