Skip to content

Commit

Permalink
fix LockTest when username contains non-alphanumeric character
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sourcejedi authored and DNF Bot committed Sep 13, 2016
1 parent 9ed52cc commit e93b566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e93b566

Please sign in to comment.