Changeset 2552

Show
Ignore:
Timestamp:
05/12/08 10:46:26 (1 year ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/qa/030-Post+urlencoded.py

    r2179 r2552  
    22from base import * 
    33 
    4 CONF = """ 
     4DIR   = "post_zero_len1" 
     5MAGIC = '<a href="http://www.alobbs.com/">Alvaro</a>' 
     6 
     7CONF  = """ 
    58vserver!1!rule!300!match = directory 
    6 vserver!1!rule!300!match!directory = /post2 
     9vserver!1!rule!300!match!directory = /%s 
    710vserver!1!rule!300!handler = cgi 
    8 """ 
     11""" % (DIR) 
     12 
     13CGI_BASE = """#!/bin/sh 
     14echo "Content-Type: text/plain" 
     15echo 
     16echo '%s' 
     17""" % (MAGIC) 
    918 
    1019class Test (TestBase): 
     
    1322        self.name = "Post with length zero" 
    1423 
    15         self.conf           = CONF 
    16         self.request        = "POST /post2/test HTTP/1.0\r\n" +\ 
    17                               "Content-type: application/x-www-form-urlencoded\r\n" +\ 
    18                               "Content-length: 0\r\n" 
    19         self.post           = "" 
    20         self.expected_error = 200 
     24        self.request          = "POST /%s/test HTTP/1.0\r\n" % (DIR)+\ 
     25                                "Content-type: application/x-www-form-urlencoded\r\n" +\ 
     26                                "Content-length: 0\r\n" 
     27        self.post             = "" 
     28        self.conf             = CONF 
     29        self.expected_error   = 200 
     30        self.expected_content = MAGIC 
    2131 
    2232    def Prepare (self, www): 
    23         self.Mkdir (www, "post2") 
    24         self.WriteFile (www, "post2/test", 0755, 
    25                         """#!/bin/sh 
     33        d = self.Mkdir (www, DIR) 
     34        self.WriteFile (d, "test", 0755, CGI_BASE) 
    2635 
    27                         echo "Content-Type: text/plain" 
    28                         echo 
    29                         echo ok 
    30                         """) 
    31