Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
	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()
Exemplo n.º 3
0
	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
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
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()