Example #1
0
 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
Example #2
0
 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
Example #3
0
 def test_fail(self):
     t = Target()
     rref = IRemoteReference(t)
     return self.shouldFail(ValueError, "test_fail", "you asked me to fail",
                            rref.callRemote, "fail")
Example #4
0
 def test_callRemoteOnly(self):
     t = HelperTarget()
     t.obj = None
     rref = IRemoteReference(t)
     rc = rref.callRemoteOnly("set", 12)
     self.failUnlessEqual(rc, None)
Example #5
0
 def test_remoteReference(self):
     r = Remote()
     rref = IRemoteReference(r)
     self.failUnlessIdentical(r, rref)
Example #6
0
 def test_remoteReference(self):
     r = Remote()
     rref = IRemoteReference(r)
     self.assertIs(r, rref)
Example #7
0
 def test_callRemoteOnly(self):
     t = HelperTarget()
     t.obj = None
     rref = IRemoteReference(t)
     rc = rref.callRemoteOnly("set", 12)
     self.failUnlessEqual(rc, None)