Commits

Robert Brewer committed af84949

Integrated tut10 into test suite.

Comments (0)

Files changed (2)

cherrypy/test/test_tutorials.py

                          '<h3>List of users:</h3>'
                          'Remi<br/>Carlos<br/>Hendrik<br/>Lorenzo Lamas<br/>'
                          '</body></html>')
+    
+    def test10SessionFilter(self):
+        load_tut_module("tut10_sessionfilter")
+        
+        helper.request('/')
+        self.assert_("viewed this page 1 times" in cpg.response.body)
+        
+        helper.request('/', [('Cookie', dict(cpg.response.headers)['Set-Cookie'])])
+        self.assert_("viewed this page 2 times" in cpg.response.body)
 
 
 if __name__ == "__main__":

cherrypy/tutorial/tut10_sessionfilter.py

 
 cpg.root = HitCounter()
 
-cpg.config.update(file = 'tut10_sessionfilter.conf')
-cpg.server.start()
+if __name__ == '__main__':
+    cpg.config.update(file = 'tut10_sessionfilter.conf')
+    cpg.server.start()
+