remove planform and show extension version into client list
This commit is contained in:
@@ -55,6 +55,35 @@ def test_clients_exits_cleanly_when_registry_is_missing():
|
||||
assert result.exit_code == 1
|
||||
assert "No browser clients found" in result.output
|
||||
|
||||
def test_clients_shows_named_profile_and_uses_socket_uuid_for_default(tmp_path):
|
||||
registry_path = tmp_path / "registry.json"
|
||||
default_socket = tmp_path / "550e8400-e29b-41d4-a716-446655440000.sock"
|
||||
work_socket = tmp_path / "work.sock"
|
||||
registry_path.write_text(
|
||||
'{"default": "%s", "work": "%s"}' % (default_socket, work_socket),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
responses = {
|
||||
"default": [{"profile": "default", "name": "Chrome", "version": "1", "extensionVersion": "2.3.4"}],
|
||||
"work": [{"profile": "default", "name": "Chrome", "version": "1", "extensionVersion": "2.3.4"}],
|
||||
}
|
||||
|
||||
def fake_send_command(command, args=None, profile=None):
|
||||
assert command == "clients.list"
|
||||
return responses[profile]
|
||||
|
||||
with patch("browser_cli.client.REGISTRY_PATH", registry_path), patch(
|
||||
"browser_cli.cli.send_command", side_effect=fake_send_command
|
||||
):
|
||||
result = CliRunner().invoke(main, ["clients"])
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "550e8400-e29b-41d4-a716-446655440000" in result.output
|
||||
assert "work" in result.output
|
||||
assert "Extension Version" in result.output
|
||||
assert "2.3.4" in result.output
|
||||
|
||||
def test_extract_markdown_command():
|
||||
with patch("browser_cli.commands.extract.send_command", return_value="# Title\n") as send_command:
|
||||
result = CliRunner().invoke(main, ["extract", "markdown"])
|
||||
|
||||
Reference in New Issue
Block a user