wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -135,6 +135,20 @@ def test_enter_dry_run_with_user():
|
||||
assert "root@personal.orb" in result.stdout
|
||||
|
||||
|
||||
def test_enter_dry_run_shows_terminfo_hint_for_ghostty():
|
||||
env = _clean_env()
|
||||
env["TERM"] = "xterm-ghostty"
|
||||
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-m", "flow", "enter", "--dry-run", "personal@orb"],
|
||||
capture_output=True, text=True, env=env,
|
||||
)
|
||||
|
||||
assert result.returncode == 0
|
||||
assert "flow will not install or modify terminfo" in result.stdout
|
||||
assert "infocmp -x xterm-ghostty | ssh" in result.stdout
|
||||
|
||||
|
||||
def test_aliases():
|
||||
"""Test that command aliases work."""
|
||||
for alias, cmd in [("dot", "dotfiles"), ("pkg", "package"), ("setup", "bootstrap")]:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Tests for command modules — registration and target parsing."""
|
||||
|
||||
from flow.commands.enter import _parse_target
|
||||
from flow.commands.enter import _parse_target, _terminfo_fix_command
|
||||
from flow.commands.container import _cname, _parse_image_ref
|
||||
|
||||
|
||||
@@ -24,6 +24,21 @@ class TestParseTarget:
|
||||
assert plat is None
|
||||
|
||||
|
||||
class TestTerminfoFixCommand:
|
||||
def test_ghostty_command(self):
|
||||
cmd = _terminfo_fix_command("xterm-ghostty", "devbox.core.lan")
|
||||
assert cmd == "infocmp -x xterm-ghostty | ssh devbox.core.lan -- tic -x -"
|
||||
|
||||
def test_wezterm_command(self):
|
||||
cmd = _terminfo_fix_command("wezterm", "user@devbox.core.lan")
|
||||
assert cmd is not None
|
||||
assert "wezterm.terminfo" in cmd
|
||||
assert "ssh user@devbox.core.lan" in cmd
|
||||
|
||||
def test_unknown_term(self):
|
||||
assert _terminfo_fix_command("xterm-256color", "devbox.core.lan") is None
|
||||
|
||||
|
||||
class TestCname:
|
||||
def test_adds_prefix(self):
|
||||
assert _cname("api") == "dev-api"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from flow.commands.dotfiles import _discover_packages, _walk_package, run_link, run_status
|
||||
from flow.commands.dotfiles import _discover_packages, _walk_package
|
||||
from flow.core.config import AppConfig, FlowContext
|
||||
from flow.core.console import ConsoleLogger
|
||||
from flow.core.paths import LINKED_STATE
|
||||
from flow.core.platform import PlatformInfo
|
||||
from flow.core.stow import LinkTree, TreeFolder
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import platform as _platform
|
||||
|
||||
import pytest
|
||||
|
||||
from flow.core.platform import PlatformInfo, detect_container_runtime, detect_platform
|
||||
from flow.core.platform import PlatformInfo, detect_platform
|
||||
|
||||
|
||||
def test_detect_platform_returns_platforminfo():
|
||||
@@ -27,6 +27,4 @@ def test_detect_platform_unsupported_arch(monkeypatch):
|
||||
detect_platform()
|
||||
|
||||
|
||||
def test_detect_container_runtime_returns_string_or_none():
|
||||
result = detect_container_runtime()
|
||||
assert result is None or result in ("docker", "podman")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user