summaryrefslogtreecommitdiff
path: root/t/unit/test_basic_message.py
blob: c0234bbd8794f422408add375e818fe40a3aae26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from unittest.mock import Mock

from amqp.basic_message import Message


class test_Message:

    def test_message(self):
        m = Message(
            'foo',
            channel=Mock(name='channel'),
            application_headers={'h': 'v'},
        )
        m.delivery_info = {'delivery_tag': '1234'}
        assert m.body == 'foo'
        assert m.channel
        assert m.headers == {'h': 'v'}
        assert m.delivery_tag == '1234'