Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 104

Show
Ignore:
Timestamp:
12/29/04 15:37:00
Author:
dpotter
Message:

changed to accomodaye new tutorial names

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test.py

    r101 r104  
    7474 
    7575tutorialTestList = [ 
    76     ('01', [('/', "cpg.response.body == 'Hello world!'")]), 
    77     ('02', [('/showMessage', "cpg.response.body == 'Hello world!'")]), 
    78     ('03', [('/greetUser?name=Bob', 
     76    ('01_helloworld.py', [('/', "cpg.response.body == 'Hello world!'")]), 
     77    ('02_expose_methods.py', [('/showMessage', "cpg.response.body == 'Hello world!'")]), 
     78    ('03_get_and_post.py', [('/greetUser?name=Bob', 
    7979            '''cpg.response.body == "Hey Bob, what's up?"''')]), 
    80     ('04', [('/links/extra/', r"""cpg.response.body == '\n            <p>Here are some extra useful links:</p>\n\n            <ul>\n                <li><a href="http://del.icio.us">del.icio.us</a></li>\n                <li><a href="http://www.mornography.de">Hendrik\'s weblog</a></li>\n            </ul>\n\n            <p>[<a href="../">Return to links page</a>]</p>\n        '""")]), 
    81     ('05', [('/another/', r"""cpg.response.body == '\n            <html>\n            <head>\n                <title>Another Page</title>\n            <head>\n            <body>\n            <h2>Another Page</h2>\n        \n            <p>\n            And this is the amazing second page!\n            </p>\n        \n            </body>\n            </html>\n        '""")]), 
    82     ('06', [('/', r"""cpg.response.body == '\n            <html>\n            <head>\n                <title>Tutorial 6 -- Aspect Powered!</title>\n            <head>\n            <body>\n            <h2>Tutorial 6 -- Aspect Powered!</h2>\n        \n            <p>\n            Isn\'t this exciting? There\'s\n            <a href="./another/">another page</a>, too!\n            </p>\n        \n            </body>\n            </html>\n        '""")]), 
    83     ('07', [('/hendrik', r"""cpg.response.body == 'Hendrik Mans, CherryPy co-developer & crazy German (<a href="./">back</a>)'""")]), 
    84     ('08', [('/', r'''cpg.response.body == "\n            During your current session, you've viewed this\n            page 1 times! Your life is a patio of fun!\n        "'''), ('/', r'''cpg.response.body == "\n            During your current session, you've viewed this\n            page 2 times! Your life is a patio of fun!\n        "''')]),  
    85     ('09', [('/', r"""cpg.response.body == '<html><body><h2>Generators rule!</h2><h3>List of users:</h3>Remi<br/>Carlos<br/>Hendrik<br/>Lorenzo Lamas<br/></body></html>'""")]), 
     80    ('04_complex_site.py', [('/links/extra/', r"""cpg.response.body == '\n            <p>Here are some extra useful links:</p>\n\n            <ul>\n                <li><a href="http://del.icio.us">del.icio.us</a></li>\n                <li><a href="http://www.mornography.de">Hendrik\'s weblog</a></li>\n            </ul>\n\n            <p>[<a href="../">Return to links page</a>]</p>\n        '""")]), 
     81    ('05_derived_objects.py', [('/another/', r"""cpg.response.body == '\n            <html>\n            <head>\n                <title>Another Page</title>\n            <head>\n            <body>\n            <h2>Another Page</h2>\n        \n            <p>\n            And this is the amazing second page!\n            </p>\n        \n            </body>\n            </html>\n        '""")]), 
     82    ('06_aspects.py', [('/', r"""cpg.response.body == '\n            <html>\n            <head>\n                <title>Tutorial 6 -- Aspect Powered!</title>\n            <head>\n            <body>\n            <h2>Tutorial 6 -- Aspect Powered!</h2>\n        \n            <p>\n            Isn\'t this exciting? There\'s\n            <a href="./another/">another page</a>, too!\n            </p>\n        \n            </body>\n            </html>\n        '""")]), 
     83    ('07_default_method.py', [('/hendrik', r"""cpg.response.body == 'Hendrik Mans, CherryPy co-developer & crazy German (<a href="./">back</a>)'""")]), 
     84    ('08_sessions.py', [('/', r'''cpg.response.body == "\n            During your current session, you've viewed this\n            page 1 times! Your life is a patio of fun!\n        "'''), ('/', r'''cpg.response.body == "\n            During your current session, you've viewed this\n            page 2 times! Your life is a patio of fun!\n        "''')]),  
     85    ('09_generators_and_yield.py', [('/', r"""cpg.response.body == '<html><body><h2>Generators rule!</h2><h3>List of users:</h3>Remi<br/>Carlos<br/>Hendrik<br/>Lorenzo Lamas<br/></body></html>'""")]), 
    8686] 
    8787 
     
    113113 
    114114    # Run tests based on tutorials 
    115     for number, myTestList in tutorialTestList: 
    116         code = open('../tutorial/tutorial%s.py' % number, 'r').read() 
     115    for filename, myTestList in tutorialTestList: 
     116        code = open('../tutorial/%s' % filename, 'r').read() 
    117117        code = code.replace('tutorial.conf', 'testsite.cfg') 
    118         print "    Testing tutorial %s..." % number
     118        print "    Testing tutorial %s..." % filename
    119119        #if ((version == 1 and number in ('06', '09')) or 
    120120        #        (version == 2 and number in ('09'))): 
     
    123123        #    continue 
    124124            
    125         helper.checkPageResult('Tutorial %s' % number, infoMap, code, myTestList, failedList) 
     125        helper.checkPageResult('Tutorial %s' % filename, infoMap, code, myTestList, failedList) 
    126126 
    127127    # Running actual unittests 

Hosted by WebFaction

Log in as guest/cpguest to create tickets