'An observer for stream errors should trigger onError to log it.'

def test_onError(self):

    self.xmlstream.dispatch(self.xmlstream, xmlstream.STREAM_CONNECTED_EVENT)
    class TestError(Exception, ):
        pass
    reason = failure.Failure(TestError())
    self.xmlstream.dispatch(reason, xmlstream.STREAM_ERROR_EVENT)
    self.assertEqual(1, len(self.flushLoggedErrors(TestError)))
