Files
hermes-agent/tests/gateway/test_table_helpers.py
teknium1 982165203d test: purge low-value tests, lane py09 (263 removed)
Change-detectors, tautologies, source-reading tests, redundant duplicates,
mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane
ledger (category + reason for every removal).
2026-09-23 03:15:26 -07:00

60 lines
1.7 KiB
Python

"""Shared GFM table → bullet conversion helpers."""
from gateway.platforms.helpers import (
convert_table_to_bullets,
)
class TestConvertTableToBullets:
def test_basic_table(self):
text = (
"| Player | Score |\n"
"|--------|-------|\n"
"| Alice | 150 |\n"
"| Bob | 120 |"
)
out = convert_table_to_bullets(text)
assert "**Alice**" in out
assert "• Score: 150" in out
assert "**Bob**" in out
assert "• Score: 120" in out
assert "• Player: Alice" not in out
def test_three_column_table(self):
text = (
"| Name | Age | City |\n"
"|:-----|----:|:----:|\n"
"| Ada | 30 | NYC |"
)
out = convert_table_to_bullets(text)
assert "**Ada**" in out
assert "• Name: Ada" not in out
assert "• Age: 30" in out
assert "• City: NYC" in out
assert "**Ada**\n• Age: 30\n• City: NYC" in out
def test_row_label_column(self):
text = (
"| | Score | Rank |\n"
"|--------|-------|------|\n"
"| Alice | 150 | 1 |\n"
"| Bob | 120 | 2 |"
)
out = convert_table_to_bullets(text)
assert "**Alice**" in out
assert "• Score: 150" in out
assert "• Rank: 1" in out
assert "**Alice**\n• Score: 150\n• Rank: 1" in out
def test_bare_pipe_table(self):
text = "head1 | head2\n--- | ---\na | b\nc | d"
out = convert_table_to_bullets(text)
assert "**a**" in out
assert "• head1: a" not in out
assert "• head2: b" in out