diff options
| author | Joris Guyonvarch | 2025-12-26 18:41:26 +0100 |
|---|---|---|
| committer | Joris Guyonvarch | 2025-12-27 20:41:44 +0100 |
| commit | a110c200e86d2325af07167531fac0f61d9681a0 (patch) | |
| tree | 90e843f915a2e153ba735849afd83710d90560bf /src/test_str_format.py | |
| parent | a26d92ad5055fa057647158eb79511e7b1841162 (diff) | |
Switch to GUI to manage the library
Allow to regroup the CLI and the view into one unique tool.
Diffstat (limited to 'src/test_str_format.py')
| -rw-r--r-- | src/test_str_format.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test_str_format.py b/src/test_str_format.py new file mode 100644 index 0000000..57bec87 --- /dev/null +++ b/src/test_str_format.py @@ -0,0 +1,20 @@ +import str_format as format + +def test_unaccent(): + assert format.unaccent('AuieTsrn') == 'AuieTsrn' + assert format.unaccent('âàéèêëîïôù') == 'aaeeeeiiou' + assert format.unaccent('ÂÀÉÈÊËÎÏÔÙ') == 'AAEEEEIIOU' + +def test_path_part(): + assert format.safe_path('L’Homme à la béquille') == 'l-homme-a-la-bequille' + +def test_cleaneup_quotes(): + assert format.cleanup_double_quotes('Bonjour, "ceci" où “cela”.', 'fr') == 'Bonjour, «ceci» où “cela”.' + assert format.cleanup_double_quotes('Hello, "this" or «that».', 'en') == 'Hello, “this” or «that».' + +def test_cleaneup_text(): + assert format.cleanup_text('l\'"est": ici... Là? OK! Yes !', 'fr') == ' l’« est » : ici… Là ? OK ! Yes !' + assert format.cleanup_text('Is it "ok" or «not»?', 'en') == ' Is it “ok” or “not”?' + +def test_cleanup_paragraphs(): + assert format.cleanup_paragraphs(' Foo\n\nBar\nBaz \n\n') == ' Foo\n\n Bar\n\n Baz' |
