From 921f17c54246deea1ce23884926155b7314828b3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 3 Jun 2025 14:22:36 +0100 Subject: [PATCH] Fix unit test --- content.py | 7 ++++--- tests.py | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/content.py b/content.py index 850754a75..71ba30a05 100644 --- a/content.py +++ b/content.py @@ -1235,6 +1235,9 @@ def _get_simplified_content(content: str) -> str: replacements = { ',': ' ', ';': ' ', + '"': ' ', + '“': ' ', + '”': ' ', '- ': ' ' } content_simplified = replace_strings(content, replacements) @@ -1382,9 +1385,7 @@ def add_html_tags(base_dir: str, http_prefix: str, max_word_length = 40 replacements = { '\r': '', - '\n': ' --linebreak-- ', - '“': ' --openquote-- ', - '”': ' --closequote-- ' + '\n': ' --linebreak-- ' } content = replace_strings(content, replacements) now_playing_str = 'NowPlaying' diff --git a/tests.py b/tests.py index 7e8f2158c..aa8842092 100644 --- a/tests.py +++ b/tests.py @@ -4176,11 +4176,10 @@ def _test_addemoji(base_dir: str): 'class="mention hashtag" rel="tag" tabindex="10">' + \ '' + \ 'hashtag".

' - # TODO - # if content_modified2 != expected_content2: - # print('expected_content2: ' + expected_content2) - # print('content_modified2: ' + content_modified2) - # assert content_modified2 == expected_content2 + if content_modified2 != expected_content2: + print('expected_content2: ' + expected_content2) + print('content_modified2: ' + content_modified2) + assert content_modified2 == expected_content2 os.chdir(base_dir_original) shutil.rmtree(base_dir_original + '/.tests',