~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/launchpad_loggerhead/tests.py

  • Committer: Gary Poster
  • Date: 2011-07-27 15:25:32 UTC
  • mto: This revision was merged to the branch mainline in revision 13541.
  • Revision ID: gary.poster@canonical.com-20110727152532-50akr19c7mgcj5qu
add config option for timeout value

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import cStringIO
5
5
import errno
6
6
import logging
 
7
import unittest
7
8
import urllib
8
9
import socket
9
10
import re
17
18
import zope.event
18
19
 
19
20
from canonical.config import config
 
21
from canonical.launchpad.webapp.errorlog import ErrorReport, ErrorReportEvent
20
22
from canonical.launchpad.webapp.vhosts import allvhosts
21
23
from canonical.testing.layers import DatabaseFunctionalLayer
22
24
from launchpad_loggerhead.app import (
248
250
        # event
249
251
        self.assertEqual(1, len(self.oopses))
250
252
        oops = self.oopses[0]
251
 
        self.assertEqual('RuntimeError', oops['type'])
 
253
        self.assertEqual('RuntimeError', oops.type)
252
254
        # runtime_failing_app doesn't call start_response, but oops_middleware
253
255
        # does because it tries to send the OOPS information to the user.
254
256
        self.assertTrue(self.start_response_called)
255
 
        self.assertEqual(_oops_html_template % {'oopsid': oops['id']},
 
257
        self.assertEqual(_oops_html_template % {'oopsid': oops.id},
256
258
                         ''.join(self._response_chunks))
257
259
 
258
260
    def test_ignores_socket_exceptions(self):
301
303
        self.assertTrue(self.start_response_called)
302
304
        # Output content is empty because of no_body_app
303
305
        self.assertEqual('', ''.join(self._response_chunks))
 
306
 
 
307
 
 
308
def test_suite():
 
309
    return unittest.TestLoader().loadTestsFromName(__name__)