def test_vogeler_server_init(self): """Test that creating a Server object works""" c = VogelerServer(callback_function=self.echo, host='localhost', username='******', password='******') self.assertType(c, 'vogeler.vogeler.VogelerServer') c.close()
def test_server_message_nondurable(self): """Test that server can send non-durable messages""" test_message = 'this is a test' c = VogelerServer(callback_function=self.echo, host='localhost', username='******', password='******') self.assertIsNone(c.message(test_message, durable=False)) c.close()
def test_server_callback(self): """Test that server callbacks work""" sample_text = 'this is a test' message_body = json.dumps(sample_text) test_message = message.SampleMessage(message_body) c = VogelerServer(callback_function=None, host='localhost', username='******', password='******') m = c.callback(test_message) self.assertEquals(m.message, sample_text) c.close()
def test_server_callback(self): """Test that server callbacks work""" sample_text = 'this is a test' message_body = json.dumps(sample_text) test_message = message.SampleMessage(message_body) c = VogelerServer(callback_function=self.echo, role='server', host='localhost', username='******', password='******') m = c.ch.basic_consume(c.queue, callback=c.callback, no_ack=True) self.assertEquals(m.message, sample_text) c.close()
def test_server_message_nondurable(self): """Test that server can send non-durable messages""" test_message = 'this is a test' c = VogelerServer(callback_function=self.echo, role='server', dsn=self.good_amqp_dsn) self.assertIsNone(c.message(test_message, durable=False)) c.close()
def test_vogeler_server_init(self): """Test that creating a Server object works""" c = VogelerServer(callback_function=self.echo, role='server', dsn=self.good_amqp_dsn) self.assertType(c, 'vogeler.vogeler.VogelerServer') c.close()