def assertWrapperExceptionTypes(self, deferred, mainType, reasonTypes):
 def cbFailed(err):
  for (reason, type) in zip(err.reasons, reasonTypes):
   reason.trap(type)
  self.assertEqual(len(err.reasons), len(reasonTypes), ('len(%s) != len(%s)' % (err.reasons, reasonTypes)))
  return err
 d = self.assertFailure(deferred, mainType)
 d.addCallback(cbFailed)
 return d

def assertWrapperExceptionTypes ( self , deferred , mainType , reasonTypes ) : def cbFailed ( err ) : for ( reason , type ) in zip ( err . reasons , reasonTypes ) : reason . trap ( type ) self . assertEqual ( len ( err . reasons ) , len ( reasonTypes ) , ( 'len(%s) != len(%s)' % ( err . reasons , reasonTypes ) ) ) return err d = self . assertFailure ( deferred , mainType ) d . addCallback ( cbFailed ) return d
assert that the given l{deferred} fails with the exception given by c{maintype} and that the exceptions wrapped by the instance of c{maintype} it fails with match the list of exception types given by c{reasontypes} .