'The I{--wsgi} option takes the fully-qualifed Python name of a WSGI
application object and creates a L{WSGIResource} at the root which
serves that application.'

def test_wsgi(self):

    options = Options()
    options.parseOptions(['--wsgi', (__name__ + '.application')])
    root = options['root']
    self.assertTrue(root, WSGIResource)
    self.assertIdentical(root._reactor, reactor)
    self.assertTrue(isinstance(root._threadpool, ThreadPool))
    self.assertIdentical(root._application, application)
    self.assertFalse(root._threadpool.started)
    reactor.fireSystemEvent('startup')
    self.assertTrue(root._threadpool.started)
    self.assertFalse(root._threadpool.joined)
    reactor.fireSystemEvent('shutdown')
    self.assertTrue(root._threadpool.joined)
