Exemple #1
0
 def test_group_id_allocation(self):
     group = Group()
     specs = [XSpec("popen"), XSpec("popen//id=hello")]
     group.allocate_id(specs[0])
     group.allocate_id(specs[1])
     gw = group.makegateway(specs[1])
     assert gw.id == "hello"
     gw = group.makegateway(specs[0])
     assert gw.id == "gw0"
     #py.test.raises(ValueError, group.allocate_id, XSpec("popen//id=hello"))
     group.terminate()
Exemple #2
0
 def test_group_id_allocation(self):
     group = Group()
     specs = [XSpec("popen"), XSpec("popen//id=hello")]
     group.allocate_id(specs[0])
     group.allocate_id(specs[1])
     gw = group.makegateway(specs[1])
     assert gw.id == "hello"
     gw = group.makegateway(specs[0])
     assert gw.id == "gw0"
     # py.test.raises(ValueError,
     #    group.allocate_id, XSpec("popen//id=hello"))
     group.terminate()
Exemple #3
0
 def test_group_ordering_and_termination(self):
     group = Group()
     group.makegateway("popen//id=3")
     group.makegateway("popen//id=2")
     group.makegateway("popen//id=5")
     gwlist = list(group)
     assert len(gwlist) == 3
     idlist = [x.id for x in gwlist]
     assert idlist == list("325")
     print(group)
     group.terminate()
     print(group)
     assert not group
     assert repr(group) == "<Group []>"
Exemple #4
0
 def test_group_ordering_and_termination(self):
     group = Group()
     group.makegateway("popen//id=3")
     group.makegateway("popen//id=2")
     group.makegateway("popen//id=5")
     gwlist = list(group)
     assert len(gwlist) == 3
     idlist = [x.id for x in gwlist]
     assert idlist == list('325')
     print (group)
     group.terminate()
     print (group)
     assert not group
     assert repr(group) == "<Group []>"
Exemple #5
0
 def test_terminate_with_proxying(self):
     group = Group()
     group.makegateway("popen//id=master")
     group.makegateway("popen//via=master//id=worker")
     group.terminate(1.0)
Exemple #6
0
 def test_terminate_with_proxying(self):
     group = Group()
     group.makegateway('popen//id=master')
     group.makegateway('popen//via=master//id=slave')
     group.terminate(1.0)
Exemple #7
0
 def test_terminate_with_proxying(self):
     group = Group()
     group.makegateway('popen//id=master')
     group.makegateway('popen//via=master//id=slave')
     group.terminate(1.0)