Improve slugify function, add tests, and enhance Makefile
Applied improvements from feature-code-quality branch: - Refactored slugify() for better readability with inline comments - Renamed log() parameter *args to *log_args (avoid shadowing built-in) - Added comprehensive unit tests for slugify function - Enhanced Makefile with typecheck and test targets - Updated build target to run type checks and tests before Docker build All tests pass and type checking succeeds.
This commit is contained in:
parent
13d3d653de
commit
3297ce5e67
4 changed files with 38 additions and 14 deletions
13
test/test_slugify.py
Normal file
13
test/test_slugify.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import unittest
|
||||
import makesite
|
||||
|
||||
|
||||
class SlugifyTest(unittest.TestCase):
|
||||
|
||||
def test_slugify(self):
|
||||
self.assertEqual(makesite.slugify('NginX est brillant'), 'nginx-est-brillant')
|
||||
self.assertEqual(makesite.slugify('Bilan hébergement 2023'), 'bilan-hebergement-2023')
|
||||
self.assertEqual(makesite.slugify('Sécurisation Docker : des pistes'), 'securisation-docker-des-pistes')
|
||||
self.assertEqual(makesite.slugify('Il court, il court, le furet'), 'il-court-il-court-le-furet')
|
||||
self.assertEqual(makesite.slugify('De GNU/Linux à gnuSystemlinuxdGnomeOs'), 'de-gnulinux-a-gnusystemlinuxdgnomeos')
|
||||
self.assertEqual(makesite.slugify('Au fait... mon téléphone'), 'au-fait-mon-telephone')
|
||||
Loading…
Add table
Add a link
Reference in a new issue