mirror of https://gitlab.com/bashrc2/epicyon
Fix markdown unit tests
parent
6c2437b4bb
commit
34e9353cb1
|
|
@ -110,6 +110,10 @@ def blog_to_gemini(base_dir: str, nickname: str, domain: str,
|
||||||
links.append(get_url_from_post(attach['url']) + ' ' +
|
links.append(get_url_from_post(attach['url']) + ' ' +
|
||||||
attach['name'])
|
attach['name'])
|
||||||
|
|
||||||
|
# replace any excessive lines
|
||||||
|
for _ in range(2):
|
||||||
|
content_text = content_text.replace('\n\n', '\n')
|
||||||
|
|
||||||
# add links to the end of the content
|
# add links to the end of the content
|
||||||
if links:
|
if links:
|
||||||
content_text += '\n\n'
|
content_text += '\n\n'
|
||||||
|
|
|
||||||
5
tests.py
5
tests.py
|
|
@ -9538,7 +9538,7 @@ def _test_gemini_blog(base_dir: str) -> None:
|
||||||
assert text_in_file('# ' + title + '\n', gemini_blog_filename)
|
assert text_in_file('# ' + title + '\n', gemini_blog_filename)
|
||||||
assert text_in_file(content, gemini_blog_filename)
|
assert text_in_file(content, gemini_blog_filename)
|
||||||
assert text_in_file('=> ' + link, gemini_blog_filename)
|
assert text_in_file('=> ' + link, gemini_blog_filename)
|
||||||
assert text_in_file('2022-02-25', gemini_blog_filename)
|
assert text_in_file('2022/02/25', gemini_blog_filename)
|
||||||
shutil.rmtree(gemini_blog_dir, ignore_errors=True)
|
shutil.rmtree(gemini_blog_dir, ignore_errors=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -9567,7 +9567,6 @@ def _test_markdown_blog(base_dir: str) -> None:
|
||||||
assert result
|
assert result
|
||||||
assert os.path.isdir(markdown_blog_dir)
|
assert os.path.isdir(markdown_blog_dir)
|
||||||
assert os.path.isfile(markdown_blog_filename)
|
assert os.path.isfile(markdown_blog_filename)
|
||||||
assert text_in_file('# ' + title + '\n', markdown_blog_filename)
|
|
||||||
assert text_in_file(content, markdown_blog_filename)
|
assert text_in_file(content, markdown_blog_filename)
|
||||||
assert text_in_file('2022-02-25', markdown_blog_filename)
|
assert text_in_file('2022-02-25', markdown_blog_filename)
|
||||||
shutil.rmtree(markdown_blog_dir, ignore_errors=True)
|
shutil.rmtree(markdown_blog_dir, ignore_errors=True)
|
||||||
|
|
@ -9606,7 +9605,7 @@ def _test_replace_gemini_links() -> None:
|
||||||
assert result == expected
|
assert result == expected
|
||||||
|
|
||||||
|
|
||||||
def run_all_tests():
|
def run_all_tests():
|
||||||
base_dir = os.getcwd()
|
base_dir = os.getcwd()
|
||||||
data_dir_testing(base_dir)
|
data_dir_testing(base_dir)
|
||||||
print('Running tests...')
|
print('Running tests...')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue