Beispiel #1
0
 def test_quit(self):
     cmd = Quit()
     arbiter = FakeArbiter()
     self.assertTrue(arbiter.watchers[0].numprocesses, 1)
     props = cmd.message('dummy')['properties']
     cmd.execute(arbiter, props)
     self.assertEqual(len(arbiter.watchers), 0)
Beispiel #2
0
    def test_decr_proc(self):
        cmd = DecrProcess()
        arbiter = FakeArbiter()
        self.assertTrue(arbiter.watchers[0].nb, 1)

        props = cmd.message('dummy')['properties']
        cmd.execute(arbiter, props)
        self.assertEqual(arbiter.watchers[0].nb, 0)
Beispiel #3
0
 def test_quit_async(self):
     cmd = Quit()
     arbiter = FakeArbiter()
     self.assertTrue(arbiter.watchers[0].nb, 1)
     props = cmd.message('dummy')['properties']
     props['async'] = True
     cmd.async_execute(arbiter, props)
     self.assertEqual(len(arbiter.watchers), 0)