Update tests after adding slash to href for directories.

This commit is contained in:
Emil Mikulic 2022-10-02 11:38:12 +11:00
parent 1e4cddb6b6
commit 1f166293b7
1 changed files with 3 additions and 3 deletions

View File

@ -120,7 +120,7 @@ class TestHelper(unittest.TestCase):
def assertIsIndex(self, body, path):
self.assertContains(body,
'<a href="..">..</a>/',
'<a href="../">..</a>/',
'Generated by darkhttpd')
def assertIsInvalid(self, body, path):
@ -178,8 +178,8 @@ class TestDirList(TestHelper):
resp = self.get("/")
status, hdrs, body = parse(resp)
self.assertLess(b'(', b'..') # ( sorts before ..
paren_pos = body.index(b'<a href="%28">(</a>/')
dotdot_pos = body.index(b'<a href="..">..</a>/')
paren_pos = body.index(b'<a href="%28/">(</a>/')
dotdot_pos = body.index(b'<a href="../">..</a>/')
# But we special-case .. to come first
self.assertLess(dotdot_pos, paren_pos)