mirror of
https://forge.chapril.org/tykayn/orgmode-to-gemini-blog
synced 2025-06-20 09:04:42 +02:00
add series
This commit is contained in:
parent
630ff2da42
commit
3fea367e9a
11 changed files with 185 additions and 123 deletions
|
@ -1,7 +1,17 @@
|
|||
import pytest
|
||||
from utils.utils import slugify_title, find_year_and_slug_on_filename
|
||||
from utils.utils import slugify_title, find_year_and_slug_on_filename, get_series_name
|
||||
|
||||
|
||||
def find_serie_name_in_series():
|
||||
"""Test que la fonction get_series_name retourne le nom de la série si l'article appartient à une série"""
|
||||
found_serie = get_series_name("des-sauvegardes-qui-durent-mille-ans", "cipherbliss_blog")
|
||||
assert found_serie == "workflows"
|
||||
|
||||
def do_not_find_serie_name_in_series():
|
||||
"""Test que la fonction get_series_name retourne None si l'article n'appartient à aucune série"""
|
||||
found_serie = get_series_name("des-sauvegardes-qui-durent-mille-ans", "tykayn_blog")
|
||||
assert found_serie is None
|
||||
|
||||
def test_parse_file_slug_from_filename():
|
||||
"""Test que slugify conserve les accents francophones"""
|
||||
title = "20250125140244__dépasser-la-spécialisation.org"
|
||||
|
@ -10,6 +20,7 @@ def test_parse_file_slug_from_filename():
|
|||
assert slug == expected, f"Expected '{expected}' but got '{slug}'"
|
||||
|
||||
def test_slug_without_accents():
|
||||
"""Test le bon slug"""
|
||||
title = "20111201T070237__dotclear-commenter-sans-tre-oblig-de-preview.org"
|
||||
expected = "dotclear-commenter-sans-tre-oblig-de-preview"
|
||||
date_str, annee, slug = find_year_and_slug_on_filename(title)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue