Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 28 lines (23 sloc) 0.818 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
from base import *

MAGIC = "First virtual Host test magic string"

CONF = """
vserver!0200!nick = test020
vserver!0200!document_root = %s
vserver!0200!match = wildcard
vserver!0200!match!domain!1 = cherokee.test
vserver!0200!rule!1!match = default
vserver!0200!rule!1!handler = common
"""

class Test (TestBase):
    def __init__ (self):
        TestBase.__init__ (self, __file__)
        self.name = "Virtual Host"
        self.request = "GET /file HTTP/1.1\r\n" +\
                                "Connection: Close\r\n" + \
                                "Host: cherokee.test\r\n"
        self.expected_error = 200
        self.expected_content = MAGIC

    def Prepare (self, www):
        d = self.Mkdir (www, "vhost1")
        self.WriteFile (d, "file", 0444, MAGIC)

        self.conf = CONF % (d)
Something went wrong with that request. Please try again.