Пример #1
0
 def test_all_params(self):
     with broker.create('MyBroker', '123.123.123.123', 9999, 'localhost', 7777) as my_broker:
         broker_args = my_broker.args
         self.assertEqual(broker_args[0], 'MyBroker')
         self.assertEqual(broker_args[1], '123.123.123.123')
         self.assertEqual(broker_args[2], 9999)
         self.assertEqual(broker_args[3], 'localhost')
         self.assertEqual(broker_args[4], 7777)
     self.assertTrue(my_broker.shutdown_called)
Пример #2
0
 def test_broker_port(self):
     with broker.create('MyBroker', broker_port=9999) as my_broker:
         broker_args = my_broker.args
         self.assertEqual(broker_args[0], 'MyBroker')
         self.assertEqual(broker_args[1], '127.0.0.1')
         self.assertEqual(broker_args[2], 9999)
         self.assertEqual(broker_args[3], 'localhost')
         self.assertEqual(broker_args[4], 7777)
     self.assertTrue(my_broker.shutdown_called)
Пример #3
0
 def test_nao_id_and_port(self):
     with broker.create('MyBroker', nao_id='localhost', nao_port=8888) as my_broker:
         broker_args = my_broker.args
         self.assertEqual(broker_args[0], 'MyBroker')
         self.assertEqual(broker_args[1], '127.0.0.1')
         self.assertEqual(broker_args[2], 0)
         self.assertEqual(broker_args[3], 'localhost')
         self.assertEqual(broker_args[4], 8888)
     self.assertTrue(my_broker.shutdown_called)
Пример #4
0
 def test_broker_ip(self):
     with broker.create('MyBroker', broker_ip='123.123.123.123') as my_broker:
         broker_args = my_broker.args
         self.assertEqual(broker_args[0], 'MyBroker')
         self.assertEqual(broker_args[1], '123.123.123.123')
         self.assertEqual(broker_args[2], 0)
         self.assertEqual(broker_args[3], 'localhost')
         self.assertEqual(broker_args[4], 7777)
     self.assertTrue(my_broker.shutdown_called)
Пример #5
0
 def test_default_params(self):
     with broker.create('MyBroker') as my_broker:
         broker_args = my_broker.args
         self.assertEqual(broker_args[0], 'MyBroker')
         self.assertEqual(broker_args[1], '127.0.0.1')
         self.assertEqual(broker_args[2], 0)
         self.assertEqual(broker_args[3], 'localhost')
         self.assertEqual(broker_args[4], 7777)
     self.assertTrue(my_broker.shutdown_called)