def setup(self): # Creating the class and Mocking a # bunch of attributes for testing module.PgRecoveryEvent.pg_update = mock.Mock() self.test_module = module.Module() # so we can see if an event gets created self.test_module.log = mock.Mock() # we don't need to log anything self.test_module.get = mock.Mock() # so we can call pg_update self.test_module._complete = mock.Mock() # we want just to see if this event gets called self.test_module.get_osdmap = mock.Mock() # so that self.get_osdmap().get_epoch() works module._module = mock.Mock() # so that Event.refresh() works
def setup(self): # Creating the class and Mocking a # bunch of attributes for testing module.PgRecoveryEvent.pg_update = mock.Mock() module.Module._ceph_get_option = mock.Mock() # .__init__ module.Module._configure_logging = lambda *args: ... # .__init__ self.test_module = module.Module('module_name', 0, 0) # so we can see if an event gets created self.test_module.get = mock.Mock() # so we can call pg_update self.test_module._complete = mock.Mock() # we want just to see if this event gets called self.test_module.get_osdmap = mock.Mock() # so that self.get_osdmap().get_epoch() works module._module = mock.Mock() # so that Event.refresh() works