예제 #1
0
    def test_default_exchange_topics(self):
        topics = NetworkBandwidthNotification.get_exchange_topics(cfg.CONF)
        assert len(topics) == 1

        got_exchange = topics[0].exchange
        got_topics = topics[0].topics
        expected_exchange = 'akanda'
        expected_topics = set(['notifications.info'])

        assert got_exchange == expected_exchange
        assert got_topics == expected_topics
예제 #2
0
    def test_multiple_exchange_topics(self):
        CONF = mock.Mock()
        CONF.akanda_notification_exchange = 'the_exchange'
        CONF.akanda_notification_topics = ['topic1', 'topic2']
        topics = NetworkBandwidthNotification.get_exchange_topics(CONF)
        assert len(topics) == 1

        got_exchange = topics[0].exchange
        got_topics = topics[0].topics
        expected_exchange = 'the_exchange'
        expected_topics = set(['topic1.info', 'topic2.info'])

        assert got_exchange == expected_exchange
        assert got_topics == expected_topics