mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
f7304bf553
Signed-off-by: phernandez <paul@basicmachines.co> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
886 B
Python
32 lines
886 B
Python
"""Tests for the top-level `bm workspace` stub (issue #821).
|
|
|
|
The stub redirects users to `bm cloud workspace` instead of letting Typer emit a
|
|
bare "No such command 'workspace'." with exit code 2.
|
|
"""
|
|
|
|
import pytest
|
|
from typer.testing import CliRunner
|
|
|
|
from basic_memory.cli.app import app
|
|
|
|
# Importing the module registers the workspace_stub command on the top-level app.
|
|
import basic_memory.cli.commands.workspace # noqa: F401
|
|
|
|
runner = CliRunner()
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"argv",
|
|
[
|
|
["workspace"],
|
|
["workspace", "list"],
|
|
["workspace", "set-default", "foo"],
|
|
],
|
|
)
|
|
def test_workspace_stub_redirects_to_cloud_workspace(argv):
|
|
"""Every `bm workspace ...` form exits 1 and points to `bm cloud workspace`."""
|
|
result = runner.invoke(app, argv)
|
|
|
|
assert result.exit_code == 1, result.output
|
|
assert "bm cloud workspace" in result.output
|