@staticmethod
    def _test_rpc():
        from zero import Zero, ZeroSetup
        class Z(ZeroRPC):
            def hi(self):
                return "hello"

            def sqr(self, x):
                return x*x

        def listen():
            zero = Zero(ZeroSetup('rep', 8000)).activated(Z())
            for _, msg in izip(range(2), zero):
                zero(msg)
            zero.close()

        from threading import Thread
        t = Thread(name='TestRPC', target=listen)
        t.daemon = True
        t.start()

        zero = Zero(ZeroSetup('req', 8000))
        msg = ['hi']
        rep = zero(msg)
        print 'REP %r' % rep
        msg = ['sqr', {'x': 10}]
        rep = zero(msg)
        print 'REP %r' % rep
        zero.close()
        t.join()
Checks if repository is empty without any changesets
dataset/ETHPy150Open philipbergen/zero/py/zero/rpc.py/ZeroRPC._test_rpc--crossover with--dataset/ETHPy150Open codeinn/vcs/vcs/backends/hg/repository.py/MercurialRepository._empty