'Test publisher config parameters.'

def test_zaqar_publisher_config(self):

    parsed_url = urlparse.urlparse('zaqar://')
    self.assertRaises(ValueError, zaqar.ZaqarPublisher, self.CONF, parsed_url)
    parsed_url = urlparse.urlparse('zaqar://?queue=foo&ttl=bar')
    self.assertRaises(ValueError, zaqar.ZaqarPublisher, self.CONF, parsed_url)
    parsed_url = urlparse.urlparse('zaqar://?queue=foo&ttl=60')
    publisher = zaqar.ZaqarPublisher(self.CONF, parsed_url)
    self.assertEqual(60, publisher.ttl)
    parsed_url = urlparse.urlparse('zaqar://?queue=foo')
    publisher = zaqar.ZaqarPublisher(self.CONF, parsed_url)
    self.assertEqual(3600, publisher.ttl)
    self.assertEqual('foo', publisher.queue_name)
