Exemplo n.º 1
0
    def test_save_restore(self):
        print 
        from swarm.globals import _swarm_ctx_stack
        sample = list(sorted(generator()))
        print '>>>>>>'
        for SIG in signals.EXITSIGNALS[1:2]:
            reset_exit_state()
            for before in range(len(sample))[1:]:
                result = []
                gen = generator()
                for i in range(before):
                    result.append(next(gen))
                Process(current_process().pid).send_signal(SIG)
                list(gen)
                states = reset_exit_state()
                for item in restore(*states):
                    result.append(item)

                result = list(sorted(result))
                self.assertTrue(result == sample)
Exemplo n.º 2
0
 def setUp(self):
     reset_exit_state()
Exemplo n.º 3
0
 def setUp(self):
     reset_exit_state()
     self.app = Swarm(__name__)
     self.app.config.from_object(config)