feat: add hermes-meshtastic platform plugin and Gitea Actions release workflow
release / test-and-release (push) Successful in 1m5s
release / test-and-release (push) Successful in 1m5s
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
from hermes_meshtastic.adapter import strip_markdown, chunk_text
|
||||
|
||||
|
||||
def test_strip_markdown():
|
||||
raw = "# Heading\n**bold text** and *italic* with `inline code`\n- bullet 1\n- bullet 2"
|
||||
cleaned = strip_markdown(raw)
|
||||
assert "**" not in cleaned
|
||||
assert "*" not in cleaned
|
||||
assert "`" not in cleaned
|
||||
assert "#" not in cleaned
|
||||
assert "bold text and italic with inline code" in cleaned
|
||||
|
||||
|
||||
def test_chunk_text_small():
|
||||
text = "Short LoRa message."
|
||||
chunks = chunk_text(text, limit=180)
|
||||
assert len(chunks) == 1
|
||||
assert chunks[0] == text
|
||||
|
||||
|
||||
def test_chunk_text_long():
|
||||
text = "Word " * 50 # 250 characters
|
||||
chunks = chunk_text(text, limit=100)
|
||||
assert len(chunks) > 1
|
||||
for c in chunks:
|
||||
assert len(c) <= 100
|
||||
Reference in New Issue
Block a user