mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 21:03:21 -07:00
Update cherrpy to 17.4.2
This commit is contained in:
parent
f28e741ad7
commit
4d6279a626
131 changed files with 15864 additions and 10389 deletions
35
lib/cherrypy/test/test_wsgi_vhost.py
Normal file
35
lib/cherrypy/test/test_wsgi_vhost.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
import cherrypy
|
||||
from cherrypy.test import helper
|
||||
|
||||
|
||||
class WSGI_VirtualHost_Test(helper.CPWebCase):
|
||||
|
||||
@staticmethod
|
||||
def setup_server():
|
||||
|
||||
class ClassOfRoot(object):
|
||||
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
|
||||
@cherrypy.expose
|
||||
def index(self):
|
||||
return 'Welcome to the %s website!' % self.name
|
||||
|
||||
default = cherrypy.Application(None)
|
||||
|
||||
domains = {}
|
||||
for year in range(1997, 2008):
|
||||
app = cherrypy.Application(ClassOfRoot('Class of %s' % year))
|
||||
domains['www.classof%s.example' % year] = app
|
||||
|
||||
cherrypy.tree.graft(cherrypy._cpwsgi.VirtualHost(default, domains))
|
||||
|
||||
def test_welcome(self):
|
||||
if not cherrypy.server.using_wsgi:
|
||||
return self.skip('skipped (not using WSGI)... ')
|
||||
|
||||
for year in range(1997, 2008):
|
||||
self.getPage(
|
||||
'/', headers=[('Host', 'www.classof%s.example' % year)])
|
||||
self.assertBody('Welcome to the Class of %s website!' % year)
|
Loading…
Add table
Add a link
Reference in a new issue