def test_event_hubs_simple_batch_receive(live_eventhub_config): source = "amqps://{}:{}@{}/{}/ConsumerGroups/{}/Partitions/{}".format( quote_plus(live_eventhub_config['key_name']), quote_plus(live_eventhub_config['access_key']), live_eventhub_config['hostname'], live_eventhub_config['event_hub'], live_eventhub_config['consumer_group'], live_eventhub_config['partition']) messages = uamqp.receive_messages(source, max_batch_size=10) assert len(messages) <= 10 message = uamqp.receive_messages(source, max_batch_size=1) assert len(message) == 1
def test_event_hubs_single_batch_receive(live_eventhub_config): plain_auth = authentication.SASLPlain(live_eventhub_config['hostname'], live_eventhub_config['key_name'], live_eventhub_config['access_key']) source = "amqps://{}/{}/ConsumerGroups/{}/Partitions/{}".format( live_eventhub_config['hostname'], live_eventhub_config['event_hub'], live_eventhub_config['consumer_group'], live_eventhub_config['partition']) message = uamqp.receive_messages(source, auth=plain_auth, timeout=5000) assert len(message) <= 300