fix(stocktwits): decode HTML entities in message bodies

- bodies reach the prompt and the screen as plain text (S&P, wasn't) rather than escaped (S&P, wasn't)
This commit is contained in:
Yijia-Xiao
2026-09-24 05:00:36 +00:00
parent 24c38602e5
commit 4187716842
2 changed files with 15 additions and 2 deletions
+7
View File
@@ -114,3 +114,10 @@ class TestStockTwitsScreening:
with patch.object(stocktwits, "urlopen", return_value=_stream("SPAM")):
out = stocktwits.fetch_stocktwits_messages("NVDA", screen=_drop_spam)
assert "none of the 1 StockTwits messages is about $NVDA" in out
@pytest.mark.unit
def test_html_entities_in_message_bodies_are_decoded():
with patch.object(stocktwits, "urlopen", return_value=_stream("S&P wasn't up")):
out = stocktwits.fetch_stocktwits_messages("NVDA")
assert "S&P wasn't up" in out