Skip to content

Commit

Permalink
[fix] add tests for #190
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed Feb 26, 2019
1 parent 96cd10b commit 310f752
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_amqp.py
Expand Up @@ -10,6 +10,7 @@

import pytest
import shortuuid
from aiormq import ChannelLockedResource

import aio_pika
import aio_pika.exceptions
Expand Down Expand Up @@ -1404,6 +1405,19 @@ async def test_delivery_fail(self):
routing_key=queue.name
)

async def test_channel_locked_resource(self):
ch1 = await self.create_channel()
ch2 = await self.create_channel()

qname = self.get_random_name("channel", "locked", "resource")

q1 = await ch1.declare_queue(qname, exclusive=True)
await q1.consume(print, exclusive=True)

with self.assertRaises(ChannelLockedResource):
q2 = await ch2.declare_queue(qname, exclusive=True)
await q2.consume(print, exclusive=True)


class MessageTestCase(unittest.TestCase):
def test_message_copy(self):
Expand Down

0 comments on commit 310f752

Please sign in to comment.