'Check that the appropriate kind of error is raised when a given command
is sent to a given protocol.'

def errorCheck(self, err, proto, cmd, **kw):

    (c, s, p) = connectedServerAndClient(ServerClass=proto, ClientClass=proto)
    d = c.callRemote(cmd, **kw)
    d2 = self.failUnlessFailure(d, err)
    p.flush()
    return d2
