Skip to content

Commit a6a59f4

Browse files
authored
Merge pull request #36 from annatisch/debug
Bug fixes
2 parents 4da7786 + 318afce commit a6a59f4

22 files changed

+651
-156
lines changed

HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Release History
44
===============
55

6+
1.0.1 (2018-08-29)
7+
++++++++++++++++++
8+
9+
- Added some more checks in place to prevent lock hanging on a keybaord interrupt.
10+
- Fixed bug in setting MessageProperties.subject as string or bytes.
11+
- `uamqp.send_message` now returns a list of `uamqp.constants.MessageState` to indicate the success of each message sent.
12+
13+
614
1.0.0 (2018-08-20)
715
++++++++++++++++++
816

build_many_linux_32bit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
# To execute this script:
55
# docker run --rm -v $PWD:/data local/manylinux_crypto32 /data/build_many_linux_32bit.sh
66

7-
export UAMQP_VERSION="1.0.0"
7+
export UAMQP_VERSION="1.0.1"
88

99
export CPATH="/opt/pyca/cryptography/openssl/include"
1010
export LIBRARY_PATH="/opt/pyca/cryptography/openssl/lib"

build_many_linux_64bit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
# To execute this script:
55
# docker run --rm -v $PWD:/data local/manylinux_crypto64 /data/build_many_linux_64bit.sh
66

7-
export UAMQP_VERSION="1.0.0"
7+
export UAMQP_VERSION="1.0.1"
88

99
export CPATH="/opt/pyca/cryptography/openssl/include"
1010
export LIBRARY_PATH="/opt/pyca/cryptography/openssl/lib"

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ pytest>=3.4.1
33
pytest-asyncio>=0.6.0
44
docutils>=0.14
55
pygments>=2.2.0
6-
pylint==1.8.4
6+
pylint==2.1.1

samples/conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def live_iothub_config():
2929
try:
3030
config = {}
3131
config['hostname'] = os.environ['IOTHUB_HOSTNAME']
32+
config['hub_name'] = os.environ['IOTHUB_HUB_NAME']
3233
config['device'] = os.environ['IOTHUB_DEVICE']
34+
config['endpoint'] = os.environ['IOTHUB_ENDPOINT']
3335
config['key_name'] = os.environ['IOTHUB_SAS_POLICY']
3436
config['access_key'] = os.environ['IOTHUB_SAS_KEY']
3537
config['consumer_group'] = "$Default"
@@ -39,3 +41,15 @@ def live_iothub_config():
3941
else:
4042
return config
4143

44+
45+
@pytest.fixture()
46+
def rabbit_mq_config():
47+
try:
48+
config = {}
49+
config['hostname'] = os.environ['RABBITMQ_HOSTNAME']
50+
config['path'] = os.environ['RABBITMQ_PATH']
51+
except KeyError:
52+
pytest.skip("Live RabbitMQ configuration not found.")
53+
else:
54+
return config
55+

samples/test_azure_event_hubs_send.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def test_event_hubs_simple_send(live_eventhub_config):
3131
sas_auth = authentication.SASTokenAuth.from_shared_access_key(
3232
uri, live_eventhub_config['key_name'], live_eventhub_config['access_key'])
3333
target = "amqps://{}/{}".format(live_eventhub_config['hostname'], live_eventhub_config['event_hub'])
34-
uamqp.send_message(target, msg_content, auth=sas_auth, debug=True)
34+
result = uamqp.send_message(target, msg_content, auth=sas_auth, debug=True)
35+
assert result == [uamqp.constants.MessageState.SendComplete]
3536

3637

3738
def test_event_hubs_client_send_sync(live_eventhub_config):
@@ -45,7 +46,7 @@ def test_event_hubs_client_send_sync(live_eventhub_config):
4546
for _ in range(10):
4647
header = uamqp.message.MessageHeader()
4748
header.durable = True
48-
props = uamqp.message.MessageProperties(message_id=b"message id")
49+
props = uamqp.message.MessageProperties(message_id=b"message id", subject="test_subject")
4950
msg_content = b"hello world"
5051
message = uamqp.Message(
5152
msg_content,
@@ -116,7 +117,7 @@ def data_generator():
116117
uri, live_eventhub_config['key_name'], live_eventhub_config['access_key'])
117118

118119
target = "amqps://{}/{}/Partitions/0".format(live_eventhub_config['hostname'], live_eventhub_config['event_hub'])
119-
send_client = uamqp.SendClient(target, auth=sas_auth, debug=False)
120+
send_client = uamqp.SendClient(target, auth=sas_auth, debug=True)
120121
for _ in range(10):
121122
message_batch = uamqp.message.BatchMessage(data_generator())
122123
send_client.queue_message(message_batch)
@@ -134,4 +135,4 @@ def data_generator():
134135
config['consumer_group'] = "$Default"
135136
config['partition'] = "0"
136137

137-
test_event_hubs_client_send_sync(config)
138+
test_event_hubs_batch_send_sync(config)

0 commit comments

Comments
 (0)