def test_compat_exchange_is_string(self): producer = TaskPublisher(exchange='foo', app=self.app) self.assertIsInstance(producer.exchange, Exchange) self.assertEqual(producer.exchange.name, 'foo') self.assertEqual(producer.exchange.type, 'direct') producer = TaskPublisher(exchange='foo', exchange_type='topic', app=self.app) self.assertEqual(producer.exchange.type, 'topic')
def test_compat_exchange_is_string(self): producer = TaskPublisher(exchange="foo", app=self.app) self.assertIsInstance(producer.exchange, Exchange) self.assertEqual(producer.exchange.name, "foo") self.assertEqual(producer.exchange.type, "direct") producer = TaskPublisher(exchange="foo", exchange_type="topic", app=self.app) self.assertEqual(producer.exchange.type, "topic")
def test_compat_exchange_is_Exchange(self): producer = TaskPublisher(exchange=Exchange('foo')) self.assertEqual(producer.exchange.name, 'foo')