"""Tests for flow.core.console.""" from flow.core.console import Console def test_info_prints_message(capsys): c = Console(color=False) c.info("hello") assert "hello" in capsys.readouterr().out def test_quiet_suppresses_info(capsys): c = Console(quiet=True, color=False) c.info("hidden") assert capsys.readouterr().out == "" def test_quiet_does_not_suppress_error(capsys): c = Console(quiet=True, color=False) c.error("visible") captured = capsys.readouterr() assert "visible" in captured.err or "visible" in captured.out def test_table_prints_headers_and_rows(capsys): c = Console(color=False) c.table(["NAME", "STATUS"], [["foo", "ok"], ["bar", "fail"]]) output = capsys.readouterr().out assert "NAME" in output assert "foo" in output assert "bar" in output def test_no_color_strips_ansi(capsys): c = Console(color=False) c.info("test") output = capsys.readouterr().out assert "\033[" not in output