Example #1
0
    def testUnexport(self):
        @rpc.export
        def foo():
            print "foo()"

        rpc.refresh()
        assert "foo" in rpc._exported_callables and rpc._exported_callables["foo"] == foo

        rpc.unexport("foo")
        rpc.refresh()
        assert "foo" not in rpc._exported_callables
Example #2
0
    def testUnexport(self):
        @rpc.export
        def foo():
            print "foo()"

        rpc.refresh()
        assert 'foo' in rpc._exported_callables and rpc._exported_callables[
            'foo'] == foo

        rpc.unexport('foo')
        rpc.refresh()
        assert 'foo' not in rpc._exported_callables
Example #3
0
    def testUnexport(self):
        q = self.QueueService()
        rpc.export('q', q)  # export an instance, explicitly specify name
        rpc.refresh()
        assert 'QueueService.count' in rpc._exported_callables and rpc._exported_callables[
            'QueueService.count'] == self.QueueService.count
        assert 'q.push' in rpc._exported_callables and rpc._exported_callables[
            'q.push'] == q.push
        assert 'q.pop' not in rpc._exported_callables

        rpc.unexport('QueueService')
        rpc.refresh()
        assert 'QueueService.count' not in rpc._exported_callables
        assert 'q.push' in rpc._exported_callables and rpc._exported_callables[
            'q.push'] == q.push
        assert 'q.pop' not in rpc._exported_callables

        rpc.unexport('q')
        rpc.refresh()
        assert 'QueueService.count' not in rpc._exported_callables
        assert 'q.push' not in rpc._exported_callables
        assert 'q.pop' not in rpc._exported_callables
Example #4
0
    def testUnexport(self):
        q = self.QueueService()
        rpc.export("q", q)  # export an instance, explicitly specify name
        rpc.refresh()
        assert (
            "QueueService.count" in rpc._exported_callables
            and rpc._exported_callables["QueueService.count"] == self.QueueService.count
        )
        assert "q.push" in rpc._exported_callables and rpc._exported_callables["q.push"] == q.push
        assert "q.pop" not in rpc._exported_callables

        rpc.unexport("QueueService")
        rpc.refresh()
        assert "QueueService.count" not in rpc._exported_callables
        assert "q.push" in rpc._exported_callables and rpc._exported_callables["q.push"] == q.push
        assert "q.pop" not in rpc._exported_callables

        rpc.unexport("q")
        rpc.refresh()
        assert "QueueService.count" not in rpc._exported_callables
        assert "q.push" not in rpc._exported_callables
        assert "q.pop" not in rpc._exported_callables