def test_delete(self, _find): plugin = Mock() _find.return_value = plugin exchange = Exchange('test') # test exchange.delete(TEST_URL) # validation plugin.Exchange.assert_called_with(exchange.name, exchange.policy) impl = plugin.Exchange() impl.delete.assert_called_with(TEST_URL)
def test_unbind(self, _find): plugin = Mock() _find.return_value = plugin queue = Mock() # test exchange = Exchange('test') exchange.unbind(queue, TEST_URL) # validation plugin.Exchange.assert_called_with(exchange.name, exchange.policy) impl = plugin.Exchange() impl.unbind.assert_called_with(queue, TEST_URL)
def test_declare(self, _find): plugin = Mock() _find.return_value = plugin exchange = Exchange('test') exchange.durable = 1 exchange.auto_delete = 2 # test exchange.declare(TEST_URL) # validation plugin.Exchange.assert_called_with(exchange.name, exchange.policy) impl = plugin.Exchange() impl.declare.assert_called_with(TEST_URL) self.assertEqual(impl.durable, exchange.durable) self.assertEqual(impl.auto_delete, exchange.auto_delete)
def test_neq(self): self.assertTrue(Exchange('1') != Exchange('2')) self.assertFalse(Exchange('1') != Exchange('1'))