Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 def test_purge(self):
     b = Binding("foo", self.exchange, "foo", channel=Channel())
     b.purge()
     self.assertIn("queue_purge", b.channel)
Beispiel #4
0
 def test_get(self):
     b = Binding("foo", self.exchange, "foo", channel=Channel())
     b.get()
     self.assertIn("basic_get", b.channel)
Beispiel #5
0
 def test_delete(self):
     b = Binding("foo", self.exchange, "foo", channel=Channel())
     b.delete()
     self.assertIn("queue_delete", b.channel)
Beispiel #6
0
 def test_cancel(self):
     b = Binding("foo", self.exchange, "foo", channel=Channel())
     b.cancel("fifafo")
     self.assertIn("basic_cancel", b.channel)
Beispiel #7
0
 def test_consume(self):
     b = Binding("foo", self.exchange, "foo", channel=Channel())
     b.consume("fifafo", None)
     self.assertIn("basic_consume", b.channel)