Esempio n. 1
0
 def test_callRemote_traps_failure(self):
     class ExampleProxy:
         def not_ok(self, a, b, c=None):
             raise RuntimeError((c, b, a))
     proxy = DeferredBlockingProxy(ExampleProxy())
     d = proxy.callRemote('not_ok', 2, 3, c=8)
     error = self.assertRaises(RuntimeError, extract_result, d)
     self.assertEqual(str(error), str((8, 3, 2)))
Esempio n. 2
0
 def test_callRemote_calls_attribute(self):
     class ExampleProxy:
         def ok(self, a, b, c=None):
             return (c, b, a)
     proxy = DeferredBlockingProxy(ExampleProxy())
     d = proxy.callRemote('ok', 2, 3, c=8)
     result = extract_result(d)
     self.assertEqual((8, 3, 2), result)
Esempio n. 3
0
    def test_callRemote_traps_failure(self):
        class ExampleProxy:
            def not_ok(self, a, b, c=None):
                raise RuntimeError((c, b, a))

        proxy = DeferredBlockingProxy(ExampleProxy())
        d = proxy.callRemote('not_ok', 2, 3, c=8)
        error = self.assertRaises(RuntimeError, extract_result, d)
        self.assertEqual(str(error), str((8, 3, 2)))
Esempio n. 4
0
    def test_callRemote_calls_attribute(self):
        class ExampleProxy:
            def ok(self, a, b, c=None):
                return (c, b, a)

        proxy = DeferredBlockingProxy(ExampleProxy())
        d = proxy.callRemote('ok', 2, 3, c=8)
        result = extract_result(d)
        self.assertEqual((8, 3, 2), result)