def test_failed_creation(self): control = Control() try: result = control.init() self.assertFalse(result) except IOError: # could not write in the location pass finally: control.cleanup()
def test_failed_creation (self): control = Control() try: result = control.init() self.assertFalse(result) except IOError: # could not write in the location pass finally: control.cleanup()
def validate (self, message, check): name = tempfile.mktemp() control = Control(name,False) try: result = control.init() self.assertTrue(result) p = Process(target=speak, args=(name,message)) p.start() string = control.loop() self.assertEqual(string, check) p.join() finally: control.cleanup() del control
def validate(self, message, check): name = tempfile.mktemp() control = Control(name, False) try: result = control.init() self.assertTrue(result) p = Process(target=speak, args=(name, message)) p.start() string = control.loop() self.assertEqual(string, check) p.join() finally: control.cleanup() del control
def run_as_cli(): import sys from exabgp.reactor.api.control import Control location = dict(zip(range(len(sys.argv)), sys.argv)).get(1, '/var/run/exabgp.sock') Control(location).run()