From e93b5663775657ac0f41feb9fcb37cbec349452b Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Tue, 13 Sep 2016 14:12:25 +0100 Subject: [PATCH] fix LockTest when username contains non-alphanumeric character Test fails for user "alan-sysop". Usernames can contain any character (apart from ':'). Nor does the man page for mkdtemp() specify what characters are used. I didn't test a username containing '/', but I don't expect that's common. Closes: #607 Approved by: ignatenkobrain --- tests/test_lock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_lock.py b/tests/test_lock.py index 360326a242..0029a3f10b 100644 --- a/tests/test_lock.py +++ b/tests/test_lock.py @@ -74,7 +74,7 @@ def test_fit_lock_dir(self): with mock.patch('dnf.util.am_i_root', return_value=False): dir_ = dnf.lock._fit_lock_dir(orig) match = re.match( - r'/var/tmp/dnf-\w+-\w+/locks/8e58d9adbd213a8b602f30604a8875f2', + r'/var/tmp/dnf-[^:]+-[^/]+/locks/8e58d9adbd213a8b602f30604a8875f2', dir_) self.assertTrue(match)