Exemple #1
0
    def test_message_copy(self):
        msg1 = Message(bytes(shortuuid.uuid(), 'utf-8'))
        msg2 = copy(msg1)

        msg1.lock()

        self.assertFalse(msg2.locked)
Exemple #2
0
    def test_message_copy(self):
        msg1 = Message(
            bytes(shortuuid.uuid(), 'utf-8'),
            content_type='application/json',
            content_encoding='text',
            timestamp=datetime(2000, 1, 1),
            headers={'h1': 'v1', 'h2': 'v2'},
        )
        msg2 = copy(msg1)

        msg1.lock()

        self.assertFalse(msg2.locked)
Exemple #3
0
def test_message_copy():
    msg1 = Message(
        bytes(shortuuid.uuid(), "utf-8"),
        content_type="application/json",
        content_encoding="text",
        timestamp=datetime(2000, 1, 1),
        headers={
            "h1": "v1",
            "h2": "v2"
        },
    )
    msg2 = copy(msg1)

    msg1.lock()

    assert not msg2.locked