Exemplo n.º 1
0
 def test_dummy_proxy(self):
     p = pulsar.concurrency('thread', pulsar.Actor, pulsar.get_actor(),
                            pulsar.Config())
     self.assertEqual(p.mailbox, None)
     self.assertEqual(p.spawning_start, None)
     self.assertEqual(p.stopping_start, None)
     self.assertEqual(p.callback, None)
     self.assertEqual(str(p), 'actor(%s)' % p.aid)
Exemplo n.º 2
0
 def test_dummy_proxy(self):
     p = pulsar.concurrency('thread', pulsar.Actor, pulsar.get_actor(),
                            pulsar.Config())
     self.assertEqual(p.mailbox, None)
     self.assertEqual(p.spawning_start, None)
     self.assertEqual(p.stopping_start, None)
     self.assertEqual(p.callback, None)
     self.assertEqual(str(p), 'actor(%s)' % p.aid)
Exemplo n.º 3
0
def create_test_arbiter(test=True):
    '''Create an instance of MockArbiter for testing'''
    commands_set = set(commands.actor_commands)
    commands_set.update(commands.arbiter_commands)
    arbiter = pulsar.concurrency('monitor', MockArbiter, 1000,
                                 None, 'arbiter', commands_set,
                                 {'__test_arbiter__': test})
    arbiter.start()
    return arbiter
Exemplo n.º 4
0
 def test_dummy_proxy(self):
     actor = pulsar.get_actor()
     self.assertRaises(ValueError, pulsar.concurrency, 'bla',
                       pulsar.Actor, actor, set(), pulsar.Config())
     impl = pulsar.concurrency('thread', pulsar.Actor, actor, set(),
                               pulsar.Config())
     p = pulsar.ActorProxy(impl)
     self.assertEqual(p.address, None)
     self.assertEqual(p.receive_from(None, 'dummy'), None)
     self.assertEqual(str(p), 'actor(%s)' % p.aid)