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)
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)
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)
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)
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)