'Call the given remote method and attach the given errback to the
resulting Deferred.  If C{exc} is not None, also assert that one
exception of that type was logged.'

def _testImpl(self, method, expected, eb, exc=None):

    rootDeferred = self.clientFactory.getRootObject()
    def gotRootObj(obj):
        failureDeferred = self._addFailingCallbacks(obj.callRemote(method), expected, eb)
        if (exc is not None):
            def gotFailure(err):
                self.assertEqual(len(self.flushLoggedErrors(exc)), 1)
                return err
            failureDeferred.addBoth(gotFailure)
        return failureDeferred
    rootDeferred.addCallback(gotRootObj)
    return rootDeferred
