Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 33 lines (28 sloc) 1.017 kB
c9e4212 @alobbs git-svn-id: svn://cherokee-project.com/cherokee/trunk@2242 5dc97367-9…
alobbs authored
1 from base import *
2 from base64 import encodestring
3
4 DIR = 'authlist3'
5 LOGIN1 = "foo"
6 PASSWD1 = "bar"
7 LOGIN2 = "harry_potter"
8 PASSWD2 = "the-trick"
9
10 CONF = """
11 vserver!1!rule!1780!match = directory
12 vserver!1!rule!1780!match!directory = /%s
13 vserver!1!rule!1780!match!final = 0
14 vserver!1!rule!1780!auth = authlist
15 vserver!1!rule!1780!auth!methods = basic
16 vserver!1!rule!1780!auth!realm = Test
17 vserver!1!rule!1780!auth!list!1!user = %s
18 vserver!1!rule!1780!auth!list!1!password = %s
19 """ % (DIR, LOGIN1, PASSWD1)
20
21 class Test (TestBase):
22 def __init__ (self):
23 TestBase.__init__ (self, __file__)
24 self.name = "AuthList basic: mismatch"
25 self.request = "GET /%s/ HTTP/1.0\r\n" % (DIR) + \
26 "Authorization: Basic %s\r\n" % (
27 encodestring ("%s:%s"%(LOGIN2,PASSWD2))[:-1])
28 self.expected_error = 401
29 self.conf = CONF
30
31 def Prepare (self, www):
32 d = self.Mkdir (www, DIR)
Something went wrong with that request. Please try again.