Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 40 lines (33 sloc) 0.989 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 29 30 31 32 33 34 35 36 37 38 39
from base import *

DIR = "ssi4"
MAGIC = '<a href="http://www.alobbs.com/">Alvaro</a>'
INC = "test_185.inc"
FILE = "example.shtml"

CONF = """
vserver!1!rule!1850!match = directory
vserver!1!rule!1850!match!directory = /%s
vserver!1!rule!1850!handler = ssi
""" % (DIR)

FILE_CONTENT = """
<html>
<head>
<title>Cherokee QA Test: SSI file size</title>
<!-- example -->
</head>
<body>
size=<!--#fsize virtual="%s" -->
</body>
</html>
""" % (INC)

class Test (TestBase):
    def __init__ (self):
        TestBase.__init__ (self, __file__)
        self.name = "SSI: file size: virtual"
        self.request = "GET /%s/%s HTTP/1.0\r\n"%(DIR, FILE)
        self.expected_error = 200
        self.expected_content = ['size=%d'%(len(MAGIC))]
        self.conf = CONF

    def Prepare (self, www):
        d = self.Mkdir (www, DIR)
        self.WriteFile (d, FILE, 0444, FILE_CONTENT)
        self.WriteFile (www, INC, 0444, MAGIC)

Something went wrong with that request. Please try again.