Tests: Improve whitespace tests for htpasswd
This commit is contained in:
parent
866aa34f54
commit
0a5fd94577
@ -119,12 +119,15 @@ class TestBaseAuthRequests(BaseTest):
|
|||||||
|
|
||||||
@pytest.mark.skipif(os.name == "nt", reason="leading and trailing "
|
@pytest.mark.skipif(os.name == "nt", reason="leading and trailing "
|
||||||
"whitespaces not allowed in file names")
|
"whitespaces not allowed in file names")
|
||||||
def test_htpasswd_whitespace_preserved(self):
|
def test_htpasswd_whitespace_user(self):
|
||||||
self._test_htpasswd("plain", " tmp : bepo ",
|
for user in (" tmp", "tmp ", " tmp "):
|
||||||
((" tmp ", " bepo ", 207),))
|
self._test_htpasswd("plain", "%s:bepo" % user, (
|
||||||
|
(user, "bepo", 207), ("tmp", "bepo", 401)))
|
||||||
|
|
||||||
def test_htpasswd_whitespace_not_trimmed(self):
|
def test_htpasswd_whitespace_password(self):
|
||||||
self._test_htpasswd("plain", " tmp : bepo ", (("tmp", "bepo", 401),))
|
for password in (" bepo", "bepo ", " bepo "):
|
||||||
|
self._test_htpasswd("plain", "tmp:%s" % password, (
|
||||||
|
("tmp", password, 207), ("tmp", "bepo", 401)))
|
||||||
|
|
||||||
def test_htpasswd_comment(self):
|
def test_htpasswd_comment(self):
|
||||||
self._test_htpasswd("plain", "#comment\n #comment\n \ntmp:bepo\n\n")
|
self._test_htpasswd("plain", "#comment\n #comment\n \ntmp:bepo\n\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user