chore: import upstream snapshot with attribution
pi-agent-plugin checks / lint (push) Has been cancelled
pi-agent-plugin checks / test (20) (push) Has been cancelled
pi-agent-plugin checks / test (22) (push) Has been cancelled
pi-agent-plugin checks / build (push) Has been cancelled
TypeScript SDK CI / check_changes (push) Has been cancelled
TypeScript SDK CI / changelog_check (push) Has been cancelled
ci / changelog_check (push) Has been cancelled
ci / check_changes (push) Has been cancelled
ci / build_mem0 (3.10) (push) Has been cancelled
ci / build_mem0 (3.11) (push) Has been cancelled
ci / build_mem0 (3.12) (push) Has been cancelled
CLI Node CI / lint (push) Has been cancelled
CLI Node CI / test (20) (push) Has been cancelled
CLI Node CI / test (22) (push) Has been cancelled
CLI Node CI / build (push) Has been cancelled
CLI Python CI / lint (push) Has been cancelled
CLI Python CI / test (3.10) (push) Has been cancelled
CLI Python CI / test (3.11) (push) Has been cancelled
CLI Python CI / test (3.12) (push) Has been cancelled
CLI Python CI / build (push) Has been cancelled
openclaw checks / lint (push) Has been cancelled
openclaw checks / test (20) (push) Has been cancelled
openclaw checks / test (22) (push) Has been cancelled
openclaw checks / build (push) Has been cancelled
opencode-plugin checks / build (push) Has been cancelled
TypeScript SDK CI / build_ts_sdk (20) (push) Has been cancelled
TypeScript SDK CI / build_ts_sdk (22) (push) Has been cancelled
TypeScript SDK CI / integration_ts_sdk (20) (push) Has been cancelled
TypeScript SDK CI / integration_ts_sdk (22) (push) Has been cancelled
pi-agent-plugin checks / lint (push) Has been cancelled
pi-agent-plugin checks / test (20) (push) Has been cancelled
pi-agent-plugin checks / test (22) (push) Has been cancelled
pi-agent-plugin checks / build (push) Has been cancelled
TypeScript SDK CI / check_changes (push) Has been cancelled
TypeScript SDK CI / changelog_check (push) Has been cancelled
ci / changelog_check (push) Has been cancelled
ci / check_changes (push) Has been cancelled
ci / build_mem0 (3.10) (push) Has been cancelled
ci / build_mem0 (3.11) (push) Has been cancelled
ci / build_mem0 (3.12) (push) Has been cancelled
CLI Node CI / lint (push) Has been cancelled
CLI Node CI / test (20) (push) Has been cancelled
CLI Node CI / test (22) (push) Has been cancelled
CLI Node CI / build (push) Has been cancelled
CLI Python CI / lint (push) Has been cancelled
CLI Python CI / test (3.10) (push) Has been cancelled
CLI Python CI / test (3.11) (push) Has been cancelled
CLI Python CI / test (3.12) (push) Has been cancelled
CLI Python CI / build (push) Has been cancelled
openclaw checks / lint (push) Has been cancelled
openclaw checks / test (20) (push) Has been cancelled
openclaw checks / test (22) (push) Has been cancelled
openclaw checks / build (push) Has been cancelled
opencode-plugin checks / build (push) Has been cancelled
TypeScript SDK CI / build_ts_sdk (20) (push) Has been cancelled
TypeScript SDK CI / build_ts_sdk (22) (push) Has been cancelled
TypeScript SDK CI / integration_ts_sdk (20) (push) Has been cancelled
TypeScript SDK CI / integration_ts_sdk (22) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
"""Tests for branding and output helpers."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from io import StringIO
|
||||
|
||||
from rich.console import Console
|
||||
|
||||
from mem0_cli.branding import print_banner, print_error, print_info, print_success, print_warning
|
||||
|
||||
|
||||
def _make_console() -> tuple[Console, StringIO]:
|
||||
buf = StringIO()
|
||||
return Console(file=buf, force_terminal=False, no_color=True, width=80), buf
|
||||
|
||||
|
||||
class TestBranding:
|
||||
def test_print_banner(self):
|
||||
console, buf = _make_console()
|
||||
print_banner(console)
|
||||
output = buf.getvalue()
|
||||
# Banner contains the mem0 ASCII art and tagline
|
||||
assert "Memory Layer" in output or "mem" in output.lower()
|
||||
|
||||
def test_print_success(self):
|
||||
console, buf = _make_console()
|
||||
print_success(console, "It worked!")
|
||||
output = buf.getvalue()
|
||||
assert "It worked!" in output
|
||||
|
||||
def test_print_error(self):
|
||||
console, buf = _make_console()
|
||||
print_error(console, "Something failed", hint="Try this fix")
|
||||
output = buf.getvalue()
|
||||
assert "Something failed" in output
|
||||
assert "Try this fix" in output
|
||||
|
||||
def test_print_error_no_hint(self):
|
||||
console, buf = _make_console()
|
||||
print_error(console, "Failed")
|
||||
output = buf.getvalue()
|
||||
assert "Failed" in output
|
||||
|
||||
def test_print_warning(self):
|
||||
console, buf = _make_console()
|
||||
print_warning(console, "Watch out")
|
||||
output = buf.getvalue()
|
||||
assert "Watch out" in output
|
||||
|
||||
def test_print_info(self):
|
||||
console, buf = _make_console()
|
||||
print_info(console, "FYI")
|
||||
output = buf.getvalue()
|
||||
assert "FYI" in output
|
||||
Reference in New Issue
Block a user