Implement test for dirname normalised bug

This commit is contained in:
Kristóf Tóth 2018-09-09 00:45:09 +02:00
parent 716e198b4b
commit 8d78f38d99

13
test.py
View File

@ -1,4 +1,5 @@
from string import punctuation, whitespace from string import punctuation, whitespace
from os.path import dirname
import pytest import pytest
@ -36,8 +37,16 @@ def test_remove_accent_from_letters(normalise):
assert normalise('éáűöüóőú') == 'eauouoou' assert normalise('éáűöüóőú') == 'eauouoou'
def test_dirname_is_not_changed(normalise): @pytest.mark.parametrize(
assert False 'path', [
'/home/user/Desktop/cica sajt',
'/Users/cat/big\tcheese',
'/etc/nginx/sites-enabled/cat.conf'
'/root/what/big celebration.txt'
]
)
def test_dirname_is_not_changed(normalise, path):
assert dirname(normalise(path)) == dirname(path)
def test_name_with_trailing_slash_is_normalised(normalise): def test_name_with_trailing_slash_is_normalised(normalise):