def test_callRemote(self): t = HelperTarget() t.obj = None rref = IRemoteReference(t) marker = rref.notifyOnDisconnect(self.ignored, "args", kwargs="foo") rref.dontNotifyOnDisconnect(marker) d = rref.callRemote("set", 12) # the callRemote should be put behind an eventual-send self.failUnlessEqual(t.obj, None) def _check(res): self.failUnlessEqual(t.obj, 12) self.failUnlessEqual(res, True) d.addCallback(_check) return d
def test_callRemote(self): t = HelperTarget() t.obj = None rref = IRemoteReference(t) marker = rref.notifyOnDisconnect(self.ignored, "args", kwargs="foo") rref.dontNotifyOnDisconnect(marker) d = rref.callRemote("set", 12) # the callRemote should be put behind an eventual-send self.assertEqual(t.obj, None) def _check(res): self.assertEqual(t.obj, 12) self.assertEqual(res, True) d.addCallback(_check) return d
def test_fail(self): t = Target() rref = IRemoteReference(t) return self.shouldFail(ValueError, "test_fail", "you asked me to fail", rref.callRemote, "fail")
def test_callRemoteOnly(self): t = HelperTarget() t.obj = None rref = IRemoteReference(t) rc = rref.callRemoteOnly("set", 12) self.failUnlessEqual(rc, None)
def test_remoteReference(self): r = Remote() rref = IRemoteReference(r) self.failUnlessIdentical(r, rref)
def test_remoteReference(self): r = Remote() rref = IRemoteReference(r) self.assertIs(r, rref)