def test_vogeler_client_init(self): """Test that creating a Client object works""" c = VogelerClient(callback_function=self.echo, role='client', dsn=self.good_amqp_dsn) self.assertType(c, 'vogeler.vogeler.VogelerClient') c.close()
def test_client_callback(self): """Test that client callbacks work""" sample_text = "this is a test" message_body = json.dumps(sample_text) test_message = message.SampleMessage(message_body) c = VogelerClient(callback_function=None, host="localhost", username="******", password="******") m = c.callback(test_message) self.assertEquals(m.message, sample_text)
def test_client_message_nondurable(self): """Test that client can send non-durable messages""" test_message = 'this is a test' c = VogelerClient(callback_function=self.echo, role='client', dsn=self.good_amqp_dsn) self.assertIsNone(c.message(test_message, durable=False)) c.close()
def test_client_callback(self): """Test that client callbacks work""" sample_text = 'this is a test' message_body = json.dumps(sample_text) test_message = message.SampleMessage(message_body) c = VogelerClient(callback_function=None, role='client', host='localhost', username='******', password='******') m = c.callback(test_message) self.assertEquals(m.message, sample_text)
def test_client_message_nondurable(self): """Test that client can send non-durable messages""" test_message = "this is a test" c = VogelerClient(callback_function=self.echo, host="localhost", username="******", password="******") self.assertIsNone(c.message(test_message, durable=False)) c.close()
def test_vogeler_client_init(self): """Test that creating a Client object works""" c = VogelerClient(callback_function=self.echo, host="localhost", username="******", password="******") self.assertType(c, "vogeler.vogeler.VogelerClient") c.close()
def test_vogeler_client_failure(self): """Test that Client object fails properly""" with self.assertRaises(Exception): VogelerClient(callback_function=self.echo, role='client', dsn=self.bad_amqp_dsn)