Polyconseil / aioamqp

AMQP implementation using asyncio
Other
280 stars 88 forks source link

Add check for bit length used by frame int value to write long-long-int #181

Closed Jacobh2 closed 5 years ago

Jacobh2 commented 5 years ago

This fixes #180 using bit_length to check if the value needs to be a long-long-int

dzen commented 5 years ago

yep, now with a nice test in https://github.com/Polyconseil/aioamqp/blob/master/aioamqp/tests/test_queue.py with a custom x-message-ttl would be good ?

Jacobh2 commented 5 years ago

I've added a test which checks with a value that requires the long-long-int type. I tested this value with the current version and it fails as predicted.

I also updated the tests to correctly use the self.host and self.port variables, which are set using the AMQP_HOST and AMQP_PORT ENV respectively. Before it was only used in one place, and otherwise defaulted to localhost, which doesn't work when running the tests using Docker

dzen commented 5 years ago

Neat !

Jacobh2 commented 5 years ago

Do you think this could be accepted and a new version on pypi to be released?

dzen commented 5 years ago

Yep, I will by the end of the week