def test_roundtrip(self):
        self.check_proplist(Message())
        self.check_proplist(Message(content_type='text/plain'))
        self.check_proplist(Message(
            content_type='text/plain',
            content_encoding='utf-8',
            application_headers={'foo': 7, 'bar': 'baz', 'd2': {'foo2': 'xxx', 'foo3': -1}},
            delivery_mode=1,
            priority=7,
        ))

        self.check_proplist(Message(
            application_headers={
                'regular': datetime(2007, 11, 12, 12, 34, 56),
                'dst': datetime(2007, 7, 12, 12, 34, 56),
            },
        ))

        n = datetime.now()
        # AMQP only does timestamps to 1-second resolution
        n = n.replace(microsecond=0)
        self.check_proplist(Message(application_headers={'foo': n}))
        self.check_proplist(Message(application_headers={'foo': Decimal('10.1')}))
        self.check_proplist(Message(application_headers={'foo': Decimal('-1987654.193')}))
        self.check_proplist(Message(timestamp=datetime(1980, 1, 2, 3, 4, 6)))
Check round-trip processing of content-properties
dataset/ETHPy150Open veegee/amqpy/amqpy/tests/test_basic_message.py/TestBasicMessage.test_roundtrip