

def setUp(self):
    super(BaseQosTestCase, self).setUp()
    with mock.patch.object(resource_manager.ResourceCallbacksManager, '_singleton', new_callable=mock.PropertyMock(return_value=False)):
        self.cons_mgr = resource_manager.ConsumerResourceCallbacksManager()
        self.prod_mgr = resource_manager.ProducerResourceCallbacksManager()
        for mgr in (self.cons_mgr, self.prod_mgr):
            mgr.clear()
    mock.patch.object(cons_registry, '_get_manager', return_value=self.cons_mgr).start()
    mock.patch.object(prod_registry, '_get_manager', return_value=self.prod_mgr).start()

dataset/ETHPy150Open openstack/neutron/neutron/tests/unit/services/qos/base.py BaseQosTestCase.setUp/original