Exemple #1
0
    def setUp(self):
        super(TestGovernor, self).setUp()
        redis_client = fakeredis_connection()
        self.governor = governor.wrap(tests.util.app, redis_client)

        config = governor.CONF['eom:governor']
        rates = governor._load_rates(config['rates_file'])

        self.test_rate = rates[0]
        self.limit = self.test_rate.limit
        self.test_url = '/v1/queues/fizbit/messages'
        self.limiter = governor._create_limiter(redis_client)

        self.default_rate = rates[1]
Exemple #2
0
    def setUp(self):
        super(TestGovernor, self).setUp()
        self.redis_client = fakeredis_connection()
        governor.configure(util.CONF)
        self.governor = governor.wrap(util.app, self.redis_client)

        config = governor.get_conf()
        rates = governor._load_rates(config['rates_file'])

        self.test_rate = rates[0]
        self.limit = self.test_rate.limit
        self.test_url = '/v1/queues/fizbit/messages'
        self.limiter = governor._create_limiter(self.redis_client)

        self.default_rate = rates[1]