def test_constructor(self):
    pub = compat.Publisher(self.connection, exchange='test_Publisher_constructor', routing_key='rkey')
    self.assertIsInstance(pub.backend, Channel)
    self.assertEqual(pub.exchange.name, 'test_Publisher_constructor')
    self.assertTrue(pub.exchange.durable)
    self.assertFalse(pub.exchange.auto_delete)
    self.assertEqual(pub.exchange.type, 'direct')
    pub2 = compat.Publisher(self.connection, exchange='test_Publisher_constructor2', routing_key='rkey', auto_delete=True, durable=False)
    self.assertTrue(pub2.exchange.auto_delete)
    self.assertFalse(pub2.exchange.durable)
    explicit = Exchange('test_Publisher_constructor_explicit', type='topic')
    pub3 = compat.Publisher(self.connection, exchange=explicit)
    self.assertEqual(pub3.exchange, explicit)
    compat.Publisher(self.connection, exchange='test_Publisher_constructor3', channel=self.connection.default_channel)
def test_constructor(self):
    pub = compat.Publisher(self.connection, exchange='test_Publisher_constructor', routing_key='rkey')
    self.assertIsInstance(pub.backend, Channel)
    self.assertEqual(pub.exchange.name, 'test_Publisher_constructor')
    self.assertTrue(pub.exchange.durable)
    self.assertFalse(pub.exchange.auto_delete)
    self.assertEqual(pub.exchange.type, 'direct')
    pub2 = compat.Publisher(self.connection, exchange='test_Publisher_constructor2', routing_key='rkey', auto_delete=True, durable=False)
    self.assertTrue(pub2.exchange.auto_delete)
    self.assertFalse(pub2.exchange.durable)
    explicit = Exchange('test_Publisher_constructor_explicit', type='topic')
    pub3 = compat.Publisher(self.connection, exchange=explicit)
    self.assertEqual(pub3.exchange, explicit)
    compat.Publisher(self.connection, exchange='test_Publisher_constructor3', channel=self.connection.default_channel)