def test_declare(self): chan = Channel() b = Binding("foo", self.exchange, "foo", channel=chan) self.assertTrue(b.is_bound) b.declare() self.assertIn("exchange_declare", chan) self.assertIn("queue_declare", chan) self.assertIn("queue_bind", chan)
def test_also_binds_exchange(self): chan = Channel() b = Binding("foo", self.exchange) self.assertFalse(b.is_bound) self.assertFalse(b.exchange.is_bound) b = b.bind(chan) self.assertTrue(b.is_bound) self.assertTrue(b.exchange.is_bound) self.assertIs(b.channel, b.exchange.channel) self.assertIsNot(b.exchange, self.exchange)
def test_purge(self): b = Binding("foo", self.exchange, "foo", channel=Channel()) b.purge() self.assertIn("queue_purge", b.channel)
def test_get(self): b = Binding("foo", self.exchange, "foo", channel=Channel()) b.get() self.assertIn("basic_get", b.channel)
def test_delete(self): b = Binding("foo", self.exchange, "foo", channel=Channel()) b.delete() self.assertIn("queue_delete", b.channel)
def test_cancel(self): b = Binding("foo", self.exchange, "foo", channel=Channel()) b.cancel("fifafo") self.assertIn("basic_cancel", b.channel)
def test_consume(self): b = Binding("foo", self.exchange, "foo", channel=Channel()) b.consume("fifafo", None) self.assertIn("basic_consume", b.channel)