From 8d78f38d99a91e61531dfac2e948e3659681fe4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sun, 9 Sep 2018 00:45:09 +0200 Subject: [PATCH] Implement test for dirname normalised bug --- test.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index 0cf3f0f..73dde3a 100644 --- a/test.py +++ b/test.py @@ -1,4 +1,5 @@ from string import punctuation, whitespace +from os.path import dirname import pytest @@ -36,8 +37,16 @@ def test_remove_accent_from_letters(normalise): assert normalise('éáűöüóőú') == 'eauouoou' -def test_dirname_is_not_changed(normalise): - assert False +@pytest.mark.parametrize( + '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):